From: robin_fernandes at uk dot ibm dot com Operating system: Windows PHP version: 5.3CVS-2007-12-03 (snap) PHP Bug Type: Class/Object related Bug description: get_class_methods() does not list all visible methods.
Description: ------------ get_class_methods() should list accessible private and protected methods if it is called from class scope (this is not stated explicitly in the doc, but is mentioned in Dmitry's comment to bug 32296). However, the testcase below shows a situation where, at a given scope, a method is accessible yet not listed by get_class_methods(). Specifically, this occurs with protected methods accessed from a superclass scope. Reproduced on php53 and php6 snaps on Windows. Reproduce code: --------------- <?php class C { public static function test() { D::prot(); var_dump(get_class_methods("D")); } } class D extends C { protected static function prot() { echo "Successfully called D::prot().\n"; } } C::test(); ?> Expected result: ---------------- Successfully called D::prot(). array(2) { [0]=> string(4) "prot" [1]=> string(4) "test" } Actual result: -------------- Successfully called D::prot(). array(1) { [0]=> string(4) "test" } -- Edit bug report at http://bugs.php.net/?id=43483&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=43483&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=43483&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=43483&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=43483&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=43483&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=43483&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=43483&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=43483&r=needscript Try newer version: http://bugs.php.net/fix.php?id=43483&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=43483&r=support Expected behavior: http://bugs.php.net/fix.php?id=43483&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=43483&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=43483&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=43483&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=43483&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=43483&r=dst IIS Stability: http://bugs.php.net/fix.php?id=43483&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=43483&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=43483&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=43483&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=43483&r=mysqlcfg