#45139 [Opn->Asn]: ReflectionProperty returns incorrect declaring class

From: Date: Sun, 01 Jun 2008 02:41:12 +0000
Subject: #45139 [Opn->Asn]: ReflectionProperty returns incorrect declaring class
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-125400@lists.php.net to get a copy of this message
ID: 45139 Updated by: felipe@php.net Reported By: david at grudl dot com -Status: Open +Status: Assigned Bug Type: Reflection related Operating System: Windows PHP Version: 5.2.6 -Assigned To: +Assigned To: felipe Previous Comments: ------------------------------------------------------------------------ [2008-05-31 01:32:22] david at grudl dot com Description: ------------ ReflectionProperty returns incorrect declaring class in PHP > 5.1.6 Reproduce code: --------------- <?php class A { private $foo; } class B extends A { } class C extends B { public $foo; } $rc = new ReflectionClass('C'); $rp = $rc->getProperty('foo'); echo $rp->getDeclaringClass()->getName(); Expected result: ---------------- C Actual result: -------------- B ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=45139&edit=1

« previous php.bugs (#125400) next »