1--TEST-- 2Bug #39001 (ReflectionProperty returns incorrect declaring class for protected properties) 3--FILE-- 4<?php 5 6class Meta { 7} 8 9class CParent extends Meta { 10 public $publicVar; 11 protected $protectedVar; 12} 13 14class Child extends CParent { 15} 16 17$r = new ReflectionClass('Child'); 18 19var_dump($r->getProperty('publicVar')->getDeclaringClass()->getName()); 20var_dump($r->getProperty('protectedVar')->getDeclaringClass()->getName()); 21 22echo "Done\n"; 23?> 24--EXPECT-- 25string(7) "CParent" 26string(7) "CParent" 27Done 28