diff options
| -rw-r--r-- | Zend/zend_execute.c | 6 | ||||
| -rw-r--r-- | Zend/zend_object_handlers.c | 4 | 
2 files changed, 7 insertions, 3 deletions
| diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index f3acee7d1f..6b9ad7e771 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -169,7 +169,11 @@ static inline void zend_fetch_property_address_inner(zval *object, znode *op2, z  	}  	if (Z_OBJ_HT_P(object)->get_property_ptr_ptr) { -		T(result->u.var).var.ptr_ptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, prop_ptr TSRMLS_CC); +		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"); +		} +		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, 0 TSRMLS_CC);  		T(result->u.var).var.ptr_ptr = &T(result->u.var).var.ptr; diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 01acba17a0..ded651952b 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -457,8 +457,8 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC  	if (zend_hash_quick_find(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, (void **) &retval) == FAILURE) {  		zval *new_zval; -		if (!zobj->ce->__get) { -			/* we don't have getter - will just add it */ +		if (!zobj->ce->__get && !zobj->ce->__set) { +			/* we don't have access controls - will just add it */  			new_zval = &EG(uninitialized_zval);  /* 			zend_error(E_NOTICE, "Undefined property: %s", Z_STRVAL_P(member)); */ | 
