"解析错误:语法错误,意外的T_FUNCTION"

0 html php

为什么我从这个片段中得到"解析错误:语法错误,第5行的upload2.php中的意外T_FUNCTION":

<?php
$title = "Click to see the picture in full size";

$images = glob('./images/*.*', GLOB_BRACE); 
usort($images, function($a, $b) {  
return filemtime($a) < filemtime($b);  
});

foreach($images as $image) {
echo '<a href="'.$image.'"><img src="'.$image.'" width="430px" height="350px"    title="'.$title.'"></a>';
}

?>
Run Code Online (Sandbox Code Playgroud)

当我使用XAMPP localhost时它工作正常.提前致谢!

Joh*_*nde 5

您正在运行不同版本的PHP.您的本地版本支持匿名功能(5.3+),但您的生产版本不支持.