]> granicus.if.org Git - php/commitdiff
MFB51: Fixed bug #36434 (Improper resolution of declaring class name of an
authorIlia Alshanetsky <iliaa@php.net>
Mon, 20 Feb 2006 15:28:15 +0000 (15:28 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 20 Feb 2006 15:28:15 +0000 (15:28 +0000)
inherited property).

ext/reflection/php_reflection.c

index f62b7453ff5915fef10ce9af324ab9885d43d6d5..d27f2a75cc1c56664d1327ae354207795f8ca64b 100644 (file)
@@ -3809,11 +3809,19 @@ ZEND_METHOD(reflection_property, getDeclaringClass)
 {
        reflection_object *intern;
        property_reference *ref;
+       zend_class_entry *tmp_ce, *ce;
+       zend_property_info *tmp_info;
 
        METHOD_NOTSTATIC_NUMPARAMS(reflection_property_ptr, 0);
        GET_REFLECTION_OBJECT_PTR(ref);
 
-       zend_reflection_class_factory(ref->ce, return_value TSRMLS_CC);
+       ce = tmp_ce = ref->ce;
+       while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, ref->prop->name, ref->prop->name_length + 1, (void **) &tmp_info) == SUCCESS) {
+               ce = tmp_ce;
+                tmp_ce = tmp_ce->parent;
+       }
+
+       zend_reflection_class_factory(ce, return_value TSRMLS_CC);
 }
 
 /* {{{ proto public string ReflectionProperty::getDocComment()