I announced
$func = array(
'a' => array(
'b' => function() {
echo "hello";
}
)
);
I try to call this way, but it does not work
$call = $func['a']['b'];
$call();
I get an error
Fatal error: function name must be a string
What can I call an anonymous function? I am using PHP 5.3.
Update
It works, I just used the wrong keys.
source
share