The only way around this is to place the result of func_get_args() in a variable and then pass that variable to the function you were calling in the first place instead of func_get_args().
WON'T WORK:
my_func(func_get_args());
WILL WORK:
$func_args=func_get_args();
my_func($func_args);
This is because the func_get_args() function must get called in the right context to return the right values as explained in the PHP documentation (PHP.net func_get_args):
Note: Because this function depends on the current scope to determine parameter details, it cannot be used as a function parameter. If this value must be passed, the results should be assigned to a variable, and that variable should be passed.
Interesting.
Thoughts?
8 comments:
Thanks for the info!
I was surprised too :)
Actually I was surprised too, but for the fact that it worked that way on my local server and threw this error on remote one.
I had the same issue as anonymous. I put it down to the fact that my local environment was running PHP 5.3 and remote 5.2. I can't promise this is the reason, but seems most likely.
thanks you. this solved my problem too. :)
thanksssssss
Thanks from Russia:) I've been looking for, but a simple solution is found in this site only! Sorry for my english))
thank you my friend ;)
Thank you so much.... searched alot but dint find any answer.... Thanks again :)
Post a Comment