为什么php不支持回调
php:
a. 代码:
a. 代码:
<?phpfunction test(func){func();}test(function(){echo "string";});
b. 输出:
Parse error: syntax error, unexpected ')', expecting variable (T_VARIABLE) in E:\test\web\test.php on line 2
javascript:
a. 代码:
function test(func){func()}test(function(){console.log(1)})
b. 输出:
1
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。