<?php
require_once _DIR_ . '/Workerman/Autoloader.php';
use Workerman\Worker;
use Workerman\Lib\Timer;
$w = new \Workerman\Worker();
$w->onWorkerStart=function(){
$timer_id=Timer::add(1, function ($client_id) {
var_dump(time() . " " . $client_id);
},,true);
Timer::add(10,function()use($timer_id){
var_dump('check timer id : '.$timer_id);
var_dump('check client id : '.$client_id); **<- 怎么把$client_id 值放这个地方**
},,false);
};
?>
试试: