#39001 [Opn->Csd]: ReflectionProperty returns incorrect declaring class for protected properties
| From: | tony2001@php.net | Date: | Mon, 02 Oct 2006 12:16:40 +0000 |
| Subject: | #39001 [Opn->Csd]: ReflectionProperty returns incorrect declaring class for protected properties | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-102984@lists.php.net to get a copy of this message | ||
ID: 39001
Updated by: tony2001@php.net
Reported By: kzantow at gmail dot com
-Status: Open
+Status: Closed
Bug Type: Class/Object related
Operating System: Windows XP SP2
PHP Version: 5.1.6
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:
------------------------------------------------------------------------
[2006-09-30 05:20:34] kzantow at gmail dot com
Description:
------------
ReflectionProperty returns incorrect declaring class for protected
properties.
Reproduce code:
---------------
class Parent {
public $publicVar;
protected $protectedVar;
}
class Child extends Parent {
}
$r = new ReflectionClass('Child');
print $r->getProperty('publicVar')->getDeclaringClass()->getName();
print $r->getProperty('protectedVar')->getDeclaringClass()->getName();
Expected result:
----------------
ParentClass
ParentClass
Actual result:
--------------
ParentClass
ChildClass
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39001&edit=1