cvs: ZendEngine2 / zend_reflection_api.c

From: Date: Thu, 26 Feb 2004 01:06:18 +0000
Subject: cvs: ZendEngine2 / zend_reflection_api.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-2412@lists.php.net to get a copy of this message
helly Wed Feb 25 20:06:18 2004 EDT Modified files: /ZendEngine2 zend_reflection_api.c Log: Fix problem with Reflection_Property (patch from Timm slightly modified). http://cvs.php.net/diff.php/ZendEngine2/zend_reflection_api.c?r1=1.88&r2=1.89&ty=u Index: ZendEngine2/zend_reflection_api.c diff -u ZendEngine2/zend_reflection_api.c:1.88 ZendEngine2/zend_reflection_api.c:1.89 --- ZendEngine2/zend_reflection_api.c:1.88 Wed Feb 25 03:58:56 2004 +++ ZendEngine2/zend_reflection_api.c Wed Feb 25 20:06:18 2004 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_reflection_api.c,v 1.88 2004/02/25 08:58:56 sebastian Exp $ */ +/* $Id: zend_reflection_api.c,v 1.89 2004/02/26 01:06:18 helly Exp $ */ #include "zend.h" #include "zend_API.h" #include "zend_exceptions.h" @@ -771,7 +771,11 @@ zend_class_entry *tmp_ce = ce->parent; zend_property_info *tmp_info; - while (tmp_ce && zend_hash_find(&ce->properties_info, prop_name, strlen(prop_name) + 1, (void **) &tmp_info) == SUCCESS) { + while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, prop_name, strlen(prop_name) + 1, (void **) &tmp_info) == SUCCESS) { + if (tmp_info->flags & ZEND_ACC_PRIVATE) { + /* private in super class => NOT the same property */ + break; + } ce = tmp_ce; prop = tmp_info; tmp_ce = tmp_ce->parent; @@ -2564,20 +2568,25 @@ "Property %s::$%s does not exist", ce->name, name_str); return; } - free_alloca(lcname); 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_property_info *tmp_info; - while (tmp_ce && zend_hash_find(&ce->properties_info, name_str, name_len + 1, (void **) &tmp_info) == SUCCESS) { + while (tmp_ce && zend_hash_find(&tmp_ce->properties_info, lcname, name_len + 1, (void **) &tmp_info) == SUCCESS) { + if (tmp_info->flags & ZEND_ACC_PRIVATE) { + /* private in super class => NOT the same property */ + break; + } ce = tmp_ce; property_info = tmp_info; tmp_ce = tmp_ce->parent; } } + free_alloca(lcname); + MAKE_STD_ZVAL(classname); ZVAL_STRINGL(classname, ce->name, ce->name_length, 1); zend_hash_update(Z_OBJPROP_P(object), "class", sizeof("class"), (void **) &classname, sizeof(zval *), NULL);

« previous php.zend-engine.cvs (#2412) next »