【发布时间】:2012-07-11 04:28:14
【问题描述】:
class test
{
public $do;
function __construct($data="")
{
$this->parse($data);
}
private function parse($data)
{
// Decoding the functions
$decoded_data = json_decode($data,true);
array_walk_recursive($decoded_data,function(&$function) {
$first_line = strtok($function, "\n");
preg_match("/\/\*#(.*?)\#*\//",$first_line,$matches);
$function = create_function($matches[1],$function);
});
$this->do = $decoded_data;
}
}
Parse error: syntax error, unexpected T_FUNCTION
错误在:
array_walk_recursive($decoded_data,function(&$function)
【问题讨论】:
-
您能否确保粘贴上面的代码与您的文件中存在的完全相同?从第一行开始复制/粘贴:
-
也可以打出电话...谢谢!
-
你通常可以通过谷歌搜索 php 错误消息得到非常相关的结果,这里是真的。
标签: syntax syntax-error php