I'm trying to write some nested PHP anonymus functions, the structure is the one that you see below and my question is: how can I make it work without errors?
$abc = function($code){
$function_A = function($code){
return $code;
};
$function_B = function($code){
global $function_A;
$text = $function_A($code);
return $text;
};
$function_B($code);
};
echo $abc('abc');
The output is Fatal error: Function name must be a string in this line:
$text = $function_A($code);
This message does not say anything to me :(