问题
I couldn't find the section in the PHP manual that explains use
I have the code
$num = 0;
array_walk_recursive($_REQUEST, function($mValue) use (&$num){
$num++;
});
and my Eclipse complains:
Parser error "'{' expected in compound-statement.
So I guess this was implemented in some PHP version.
回答1:
Anonymous functions/closures and the use language construct were implemented in version 5.3.0
@see changelog: http://php.net/manual/en/functions.anonymous.php
来源:https://stackoverflow.com/questions/20411631/when-was-function-use-closures-implemented-in-php