[PHP-DEV] Bug #10829: call_user_func() - Bug
From: [EMAIL PROTECTED] Operating system: Win2K, Solaris PHP version: 4.0.5 PHP Bug Type: Scripting Engine problem Bug description: call_user_func() - Bug Hi, I have found the following bug with the function call_user_func(): If the user function you are trying to call with 'call_user_func' requires any of its parameters to be passed by reference, PHP issues a warning stating that the function doesn't exist. Example: ?php function testme($param) { var_dump($param); } $func = testme; $param = array(1, 2); call_user_func($func, $param); ? Result: br bWarning/b: Unable to call testme() - function does not exist in bt.php/b on line b1/bbr Regards, Stefan Livieratos -- Edit Bug report at: http://bugs.php.net/?id=10829edit=1 -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Bug #10829: call_user_func() - Bug
On Sat, May 12, 2001 at 02:23:44PM -, [EMAIL PROTECTED] wrote: From: [EMAIL PROTECTED] Operating system: Win2K, Solaris PHP version: 4.0.5 PHP Bug Type: Scripting Engine problem Bug description: call_user_func() - Bug Hi, I have found the following bug with the function call_user_func(): If the user function you are trying to call with 'call_user_func' requires any of its parameters to be passed by reference, PHP issues a warning stating that the function doesn't exist. Example: ?php function testme($param) { var_dump($param); } $func = testme; $param = array(1, 2); call_user_func($func, $param); ? Result: br bWarning/b: Unable to call testme() - function does not exist in bt.php/b on line b1/bbr if you take out the in the testme argument list it works - even weirder. tc -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Bug #10829: call_user_func() - Bug
Thies C. Arntzen wrote: On Sat, May 12, 2001 at 02:23:44PM -, [EMAIL PROTECTED] wrote: From: [EMAIL PROTECTED] Operating system: Win2K, Solaris PHP version: 4.0.5 PHP Bug Type: Scripting Engine problem Bug description: call_user_func() - Bug Hi, I have found the following bug with the function call_user_func(): If the user function you are trying to call with 'call_user_func' requires any of its parameters to be passed by reference, PHP issues a warning stating that the function doesn't exist. Example: ?php function testme($param) { var_dump($param); } $func = testme; $param = array(1, 2); call_user_func($func, $param); ? Result: br bWarning/b: Unable to call testme() - function does not exist in bt.php/b on line b1/bbr if you take out the in the testme argument list it works - even weirder. Actually, it doesn't seem that wierd to me ;) the call_user_func() expects an array of parameters, therefore, the correct code would look like: $func = testme; $param = array(1, 2); call_user_func($func, array($param)); But instead the code passes a constant value 1 to the first argument, and 1 cannot be passed by reference. The error generated is kinda a bug, call_user_func() should emit a more general error message, but otherwise its not a real bug. -Sterling -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DEV] Bug #10829: call_user_func() - Bug
Sterling Hughes wrote: Thies C. Arntzen wrote: On Sat, May 12, 2001 at 02:23:44PM -, [EMAIL PROTECTED] wrote: From: [EMAIL PROTECTED] Operating system: Win2K, Solaris PHP version: 4.0.5 PHP Bug Type: Scripting Engine problem Bug description: call_user_func() - Bug Hi, I have found the following bug with the function call_user_func(): If the user function you are trying to call with 'call_user_func' requires any of its parameters to be passed by reference, PHP issues a warning stating that the function doesn't exist. Example: ?php function testme($param) { var_dump($param); } $func = testme; $param = array(1, 2); call_user_func($func, $param); ? Result: br bWarning/b: Unable to call testme() - function does not exist in bt.php/b on line b1/bbr if you take out the in the testme argument list it works - even weirder. Actually, it doesn't seem that wierd to me ;) the call_user_func() expects an array of parameters, therefore, the correct code would look like: $func = testme; $param = array(1, 2); call_user_func($func, array($param)); But instead the code passes a constant value 1 to the first argument, and 1 cannot be passed by reference. The error generated is kinda a bug, call_user_func() should emit a more general error message, but otherwise its not a real bug. Never mind, I take this back ;))) call_user_func call_user_func_array() got confused in head. Take a look at the call_user_*() thread ;) -Sterling -- PHP Development Mailing List http://www.php.net/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]