From: Dmitry Stogov Date: Tue, 18 Jan 2005 09:04:43 +0000 (+0000) Subject: Fixed bug #28444 (Cannot access undefined property for object with overloaded propert... X-Git-Tag: php-5.0.4RC1~327 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5abc423112d936e59470d00a022cf667312cc652;p=php Fixed bug #28444 (Cannot access undefined property for object with overloaded property access). (Dmitry) --- diff --git a/NEWS b/NEWS index 11a8b7f9c5..58540a4038 100644 --- a/NEWS +++ b/NEWS @@ -35,6 +35,8 @@ PHP NEWS parameters). (Jani) - Fixed bug #28930 (PHP sources pick wrong header files generated by bison). (eggert at gnu dot org, Jani) +- Fixed bug #28444 (Cannot access undefined property for object with overloaded + property access). (Dmitry) - Fixed bug #28074 (FastCGI: stderr should be written in a FCGI stderr stream). (chris at ex-parrot dot com) diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 7251dd323b..40f59fe112 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -175,9 +175,15 @@ static inline void zend_fetch_property_address_inner(zval *object, znode *op2, z if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { zval **ptr_ptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, prop_ptr TSRMLS_CC); if(NULL == ptr_ptr) { - zend_error(E_ERROR, "Cannot access undefined property for object with overloaded property access"); + if (Z_OBJ_HT_P(object)->read_property && + (T(result->u.var).var.ptr = Z_OBJ_HT_P(object)->read_property(object, prop_ptr, BP_VAR_W TSRMLS_CC)) != NULL) { + T(result->u.var).var.ptr_ptr = &T(result->u.var).var.ptr; + } else { + zend_error(E_ERROR, "Cannot access undefined property for object with overloaded property access"); + } + } else { + T(result->u.var).var.ptr_ptr = ptr_ptr; } - T(result->u.var).var.ptr_ptr = ptr_ptr; } else if (Z_OBJ_HT_P(object)->read_property) { T(result->u.var).var.ptr = Z_OBJ_HT_P(object)->read_property(object, prop_ptr, BP_VAR_W TSRMLS_CC); T(result->u.var).var.ptr_ptr = &T(result->u.var).var.ptr;