#48481 [Opn->Bgs]: get_class_methods behaviour in inherited classes

From: Date: Fri, 05 Jun 2009 13:19:07 +0000
Subject: #48481 [Opn->Bgs]: get_class_methods behaviour in inherited classes
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-138058@lists.php.net to get a copy of this message
ID: 48481 User updated by: xsist10 at gmail dot com Reported By: xsist10 at gmail dot com -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: Ubuntu 9.04 PHP Version: 5.2.9 New Comment: return get_class_methods(__CLASS__); should be: return get_class_methods($this); Previous Comments: ------------------------------------------------------------------------ [2009-06-05 13:17:03] xsist10 at gmail dot com Description: ------------ get_class_methods returns the parents methods when called from a protected/public function in the parent from an inherited child. Reproduce code: --------------- class Foo { function getFunctions() { return get_class_methods(__CLASS__); } function test1() { } } class Bar extends Foo { function test2() { } } $bar = new Bar(); print_r($bar->getFunctions()); Expected result: ---------------- Array ( [0] => getFunctions [1] => test1 [2] => test2 ) Actual result: -------------- Array ( [0] => getFunctions [1] => test1 ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48481&edit=1

« previous php.bugs (#138058) next »