What's differences between ReflectionFunction invoke and call_user_func ?
My example:
function getAge($age){
return 'Your age is: '. $age;
};
echo call_user_func_array('getAge', [22]);
echo (new ReflectionFunction("getAge"))->invoke(50);
I don't understand what's practical need point ofv create ReflectionFunction in PHP? Only debug mode ?
Comments
Post a Comment