swoole之内存
一、代码
<?php // 可以用来数据共享 // 执行完后 自动释放 // 创建内存表 $table = new swoole_table(1024); // 内存表增加一列 $table->column('id', $table::TYPE_INT, 4); $table->column('name', $table::TYPE_STRING, 64); $table->column('age', $table::TYPE_INT, 3); $table->create(); // 设置数据 $table->set('tomInfo', ['id'=>1, 'name'=>'tom','age'=>20]); $table['jerryInfo'] = [ 'id'=>2, 'name'=>'jerry', 'age'=>20 ]; $table->incr('jerryInfo', 'age', 2); $table->decr('jerryInfo', 'age', 4); // 获取数据 print_r($table->get('jerryInfo')); print_r($table['jerryInfo']); // 删除数据 $table->del('tomInfo'); print_r($table->get('tomInfo'));
分情破爱始乱弃,流落天涯思别离。
如花似玉负情意,影如白昼暗自迷。
随风浮沉千叶落,行色匆匆鬓已稀。