]> granicus.if.org Git - php/commitdiff
Fixed bug #36337 (ReflectionProperty fails to return correct visibility).
authorIlia Alshanetsky <iliaa@php.net>
Mon, 13 Feb 2006 14:49:26 +0000 (14:49 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 13 Feb 2006 14:49:26 +0000 (14:49 +0000)
NEWS
ext/reflection/php_reflection.c

diff --git a/NEWS b/NEWS
index e9fa1cb533230951149d83dcbdbf51a9600008cc..636bce0ab190c1bfa7eaaa5ce2facc7af96aa9f5 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -24,6 +24,8 @@ PHP                                                                        NEWS
 - Fixed bug #36359 (splFileObject::fwrite() doesn't write when no data length 
   specified). (Tony)
 - Fixed bug #36351 (parse_url() does not parse numeric paths properly). (Ilia)
+- Fixed bug #36337 (ReflectionProperty fails to return correct visibility). 
+  (Ilia)
 - Fixed bug #36334 (Added missing documentation about realpath cache INI 
   settings). (Ilia)
 - Fixed bug #36308 (ReflectionProperty::getDocComment() does not reflect 
index 411e0ece159d092da37f49c70d3e6f3f86c0b795..d871e364591db17044dcec5db00fea1522832792 100644 (file)
@@ -3560,14 +3560,10 @@ ZEND_METHOD(reflection_property, __construct)
        
        if (!(property_info->flags & ZEND_ACC_PRIVATE)) {
                /* we have to seach the class hierarchy for this (implicit) public or protected property */
-               zend_class_entry *tmp_ce = ce->parent;
+               zend_class_entry *tmp_ce = ce;
                zend_property_info *tmp_info;
                
-               while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, name_str, name_len + 1, (void **) &tmp_info) == SUCCESS) {
-                       if (tmp_info->flags & ZEND_ACC_PRIVATE) {
-                               /* private in super class => NOT the same property */
-                               break;
-                       }
+               while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, name_str, name_len + 1, (void **) &tmp_info) != SUCCESS) {
                        ce = tmp_ce;
                        property_info = tmp_info;
                        tmp_ce = tmp_ce->parent;