From: william at 1moment dot nl Operating system: Linux PHP version: 5.2SVN-2009-08-11 (SVN) PHP Bug Type: Class/Object related Bug description: method_exists check goes wrong when checking for a static function
Description: ------------ The method_exists function can have two types of input for the first parameter: An object instance or a class name. The documentation (http://us2.php.net/manual/en/function.method-exists.php) has two examples. One for checking static methods and one for checking normal methods. (Based on the type of var for the first parameter). When i do this in php version 5.2.5 the code below will echo 'testClass has a static function named testFunction'. When i do this in php version 5.0.4 the code below will echo 'testClass has not a static function named testFunction'. I think 5.0.4 is correct behavior. Thnx! Reproduce code: --------------- Class testClass { public function testFunction() { return true; } } if(method_exists('testClass', 'testFunction')) { echo 'testClass has a static function named testFunction'; } else { echo 'testClass has not a static function named testFunction'; } Expected result: ---------------- testClass has a static function named testFunction Actual result: -------------- testClass has not a static function named testFunction -- Edit bug report at http://bugs.php.net/?id=49220&edit=1 -- Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49220&r=trysnapshot52 Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49220&r=trysnapshot53 Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49220&r=trysnapshot60 Fixed in SVN: http://bugs.php.net/fix.php?id=49220&r=fixed Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49220&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=49220&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=49220&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=49220&r=needscript Try newer version: http://bugs.php.net/fix.php?id=49220&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=49220&r=support Expected behavior: http://bugs.php.net/fix.php?id=49220&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=49220&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=49220&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=49220&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49220&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=49220&r=dst IIS Stability: http://bugs.php.net/fix.php?id=49220&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=49220&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=49220&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=49220&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=49220&r=mysqlcfg
