多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
# 4种PHP回调函数风格 匿名函数 ---- ```php $server->on('Request', function ($req, $resp) { echo "hello world"; }); ``` 类静态方法 --- ```php class A { static function test($req, $resp) { echo "hello world"; } } $server->on('Request', 'A::Test'); $server->on('Request', array('A', 'Test')); ``` 函数 ---- ```php function my_onRequest($req, $resp) { echo "hello world"; } $server->on('Request', 'my_onRequest'); ``` 对象方法 ---- ```php class A { function test($req, $resp) { echo "hello world"; } } $object = new A(); $server->on('Request', array($object, 'test')); ```