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
PHP,解析錯誤:語法錯誤,意想不到的T_FUNCTION
的錯誤是:
array_walk_recursive($decoded_data,function(&$function)
你能確保上面的代碼與你的文件中存在的代碼完全一樣嗎?從第一行開始複製/粘貼:<?php ... – 2012-07-11 04:29:17
同樣可以調出行......謝謝! – 2012-07-11 04:30:30
'$ function'有什麼? – diEcho 2012-07-11 04:31:20