Closed 2723659854 closed 4 months ago
<?php use Swoole\Thread; /** 使用map传递数据 */ use Swoole\Thread\Map; $args = Thread::getArguments(); if (empty($args)) { $map = new Map; $thread = new Thread(__FILE__, 2, $map); sleep(1); $class = new stdClass(); $class->name = "张三556565"; $map['test'] = $class; $map->add('demo','lucy'); $thread->join(); } else { $map = $args[1]; sleep(2); var_dump($map['test']); var_dump($map['demo']); var_dump($map->keys()); var_dump($map->count()); var_dump($map->values()); var_dump($map->toArray()); }
报错:Fatal error: Uncaught Error: Call to undefined method Swoole\Thread\Map::values() in /var/www/swoole/map.php:23 Stack trace:
thrown in /var/www/swoole/map.php on line 23
是我的用法错了吗
报错:Fatal error: Uncaught Error: Call to undefined method Swoole\Thread\Map::values() in /var/www/swoole/map.php:23 Stack trace:
0 {main}
thrown in /var/www/swoole/map.php on line 23