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

NEWS
ext/reflection/php_reflection.c

diff --git a/NEWS b/NEWS
index 1fea06f030a8edd3f04af8bfcdb5585a65f1279c..b2c7676169e9431f78d718fe02b89ea2557ebe96 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,8 @@ PHP                                                                        NEWS
 - Fixed tiger hash algorithm generating wrong results on big endian platforms.
   (Mike)
 - Fixed bug #36436 (DBA problem with Berkeley DB4). (Marcus)
+- Fixed bug #36434 (Improper resolution of declaring class name of an inherited
+  property). (Ilia)
 - Fixed bug #36420 (segfault when access result->num_rows after calling 
   result->close()). (Ilia)
 - Fixed bug #36403 (oci_execute() no longer supports OCI_DESCRIBE_ONLY). 
index 13498ed418c6c3986edb565fcf3af1e52c119400..da19d9a1b98f6e0717c787d842fc83060e02b142 100644 (file)
@@ -3789,11 +3789,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()