2016-08-19 07:38发布
<?php function callback($callback) { $callback(); } $obj = (object) "php aaa"; $callback = function () use ($obj) { print "This is a closure use object, msg is: {$obj->scalar}. <br />"; }; $obj->scalar = "php bbb"; //$obj = (object) "php bbb"; callback($callback);
最多设置5个标签!
一周热门 更多>