Anonymous functions = closures,
These allow the creation of functions which have no name. They are most useful as the value of callback parameters.
These allow the creation of functions which have no name. They are most useful as the value of callback parameters.
$funcName = function($name) { printf("Hello %s\r\n", $name); }; $funcName('Anonymous function'); $funcName('Closure');
No comments:
Post a Comment