#45139 [Asn->Csd]: ReflectionProperty returns incorrect declaring class
ID: 45139
Updated by: felipe@php.net
Reported By: david at grudl dot com
-Status: Assigned
+Status: Closed
Bug Type: Reflection related
Operating System: Windows
PHP Version: 5.2.6
Assigned To: felipe
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
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
Thread (3 messages)