prop_name_len = strlen(prop_name);
ce = tmp_ce = ref->ce;
while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, prop_name, prop_name_len + 1, (void **) &tmp_info) == SUCCESS) {
- ce = tmp_ce;
- tmp_ce = tmp_ce->parent;
if (tmp_info->flags & ZEND_ACC_PRIVATE) {
/* it's a private property, so it can't be inherited */
break;
}
+ ce = tmp_ce;
+ tmp_ce = tmp_ce->parent;
}
zend_reflection_class_factory(ce, return_value TSRMLS_CC);
$rc = new ReflectionClass('A');
var_dump($rc->getProperty('x')->getDeclaringClass()->getName());
+class Test {
+ private $x;
+}
+
+class Test2 extends Test {
+ public $x;
+}
+
+$rc = new ReflectionClass('Test2');
+var_dump($rc->getProperty('x')->getDeclaringClass()->getName());
+
echo "Done\n";
?>
--EXPECTF--
string(1) "C"
string(1) "B"
string(1) "A"
+string(5) "Test2"
Done