Consider the following example:
// does not work
foo( func_num_args() );
// works
$args = func_num_args();
foo( $args );
Why specifically does the former fail and the latter work?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In other words: because of the way this function works internally. The runtime is in a different state when it’s inside a regular function body and when it’s evaluating expressions to be used as parameters to another function. This was changed in 5.3.