summaryrefslogtreecommitdiff
path: root/Zend/zend_object_handlers.c
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2014-10-03 21:26:51 +0200
committerNikita Popov <nikic@php.net>2014-10-03 21:27:07 +0200
commit8617f2fa8d6feeda4c87e1c0f8697101f03429f2 (patch)
treea4f3e6daec8699a009b164689e25eccbc9e7097f /Zend/zend_object_handlers.c
parent79e05bf5578f09bb26e4a8826eb94f7f4601d4f6 (diff)
parent93288d0095cc27f8df88832e479e25ea5b00b5fd (diff)
downloadphp-git-8617f2fa8d6feeda4c87e1c0f8697101f03429f2.tar.gz
Merge branch 'PHP-5.5' into PHP-5.6
Diffstat (limited to 'Zend/zend_object_handlers.c')
-rw-r--r--Zend/zend_object_handlers.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index c7adf38f3b..a5577d0b45 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -786,9 +786,6 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, int type
/* we don't have access controls - will just add it */
new_zval = &EG(uninitialized_zval);
- if(UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
- zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name, Z_STRVAL_P(member));
- }
Z_ADDREF_P(new_zval);
if (EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) &&
property_info->offset >= 0) {
@@ -808,6 +805,12 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, int type
}
zend_hash_quick_update(zobj->properties, property_info->name, property_info->name_length+1, property_info->h, &new_zval, sizeof(zval *), (void **) &retval);
}
+
+ /* Notice is thrown after creation of the property, to avoid EG(std_property_info)
+ * being overwritten in an error handler. */
+ if (UNEXPECTED(type == BP_VAR_RW || type == BP_VAR_R)) {
+ zend_error(E_NOTICE, "Undefined property: %s::$%s", zobj->ce->name, Z_STRVAL_P(member));
+ }
} else {
/* we do have getter - fail and let it try again with usual get/set */
retval = NULL;