标签:object body value key ever 闭包 用法 this php5
php5.3新增闭包函数用法use用法(引入变量地址且随内存中值变化而变化,跳过解析顺序直接获取函数最终值)
$obj = (object) "Hello, everyone";
$callback = function () use ($obj) {
print "This is a closure use object, msg is: {$obj->scalar}. <br />/n";
};
$obj = (object) "Hello, everybody";
callback($callback);
标签:object body value key ever 闭包 用法 this php5
原文地址:http://www.cnblogs.com/docter/p/6251665.html