How can i know the actual number of param the function has,
i know that func_num_args return the number of passed args inside the function but what about outside ???
function foo($x,$y)
{
// any code
}
how can i know dynamically the real num of args that bind to that function
i take it from SO answer :
PHP function to find out the number of parameters passed into function?
func_number_args() is limited to only the function that is being called. You can’t extract information about a function dynamically outside of the function at runtime.
If you’re attempting to extract information about a function at runtime, I recommend the Reflection approach: