Re: call_user_*()
| From: | Sterling Hughes | Date: | Sun, 13 May 2001 05:36:33 +0000 |
| Subject: | Re: call_user_*() | ||
| References: | 1 2 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-55061@lists.php.net to get a copy of this message | ||
Stefan Livieratos wrote:
"Sterling Hughes" <sterling@designmultimedia.com> schrieb im Newsbeitrag news:3AFD8EF7.2030605@designmultimedia.com...Well it is needed... If you need to decide how many arguments to pass to a function at execution time then the call_user_func_array() function is critical. -SterlingHowdy all,Well, I thought that the function call_user_func_array() is supposed to be called this way. What good is it anyway? I suggest 'call_user_func_array' should be removed as it is not needed and also doesn't work with user functions that expect arguments by reference.I've been going through the call_user_*() functions inbasic_functions.c and just a couple of notes/things I found odd. 1) With a aforementioned bug, thies was right, the following code fails, but it shouldn't: <?php function get_reference_as_arg(&$param) {var_dump($param);} $name = "get_reference_as_arg"; $param1 = array(1, 2); call_user_func($name, $param1); ?> Fails. Whereas, replacing the call_user_func above with the following: call_user_func($name, array($param1));