ID: 18016 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Documentation problem Operating System: all PHP Version: 4.2.1 New Comment:
why should function_exists() check for a static method if there is method_exists() Previous Comments: ------------------------------------------------------------------------ [2002-07-01 18:24:03] [EMAIL PROTECTED] why should function_exists() check for a static method if there is method_exists() ------------------------------------------------------------------------ [2002-06-27 09:13:28] [EMAIL PROTECTED] Thanks! But how about function_exists()? function_exists(array("test","staticFunction")) doesn't work. ------------------------------------------------------------------------ [2002-06-27 08:15:38] [EMAIL PROTECTED] The syntax for calling static class methods is array('classname', 'methodname'); Reclassiyfing as documentation problem. ------------------------------------------------------------------------ [2002-06-27 08:08:05] [EMAIL PROTECTED] <? class test { function staticFunction($a) { echo "\ntest::staticFunction($a)"; } } echo "\nTest page\n"; echo 'function_exists=['.function_exists("test::staticFunction").']'; test::staticFunction(999); call_user_func_array("test::staticFunction",array(999)); ?> Result: Test page function_exists=[] test::staticFunction(999) Warning: call_user_func_array() expects first argument, 'test::staticFunction', to be a valid callback in bug.php on line 17 Must be: Test page function_exists=[TRUE] test::staticFunction(999) test::staticFunction(999) (Please, don't write me stupid comments about method_exists()! Just read one more time function name.) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18016&edit=1 -- PHP Documentation Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php