Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

What's differences between ReflectionFunction invoke and call_user_func?

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