ID: 47554 Updated by: ka...@php.net Reported By: jimmy at basicmatrix dot com -Status: Open +Status: Bogus Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 5.2.9 New Comment:
Calling a function/method with invalid parameter, eg. parameters that does not pass parameter parsing internally all return NULL. In this case FALSE is returned if something fails after the parameter parsing have passed. Previous Comments: ------------------------------------------------------------------------ [2009-03-03 23:47:58] jimmy at basicmatrix dot com Description: ------------ call_user_func_array() claims it "Returns the function result, or FALSE on error." My testing shows it returns NULL if the callback function is not a valid callback. Reproduce code: --------------- <?php function callable() { return 'Good.'; } $return = call_user_func_array('callable',array()); var_dump($return); $return = call_user_func_array('not_callable',array()); var_dump($return); ?> Expected result: ---------------- string(5) "Good." Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'not_callable' was given in _______ on line 9 FALSE Actual result: -------------- string(5) "Good." Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'not_callable' was given in _______ on line 9 NULL ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47554&edit=1