|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits              [2006-10-02 12:16 UTC] tony2001@php.net
 | |||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Wed Oct 29 09:00:01 2025 UTC | 
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