Skip to content

Commit 9c123ac

Browse files
committed
just expect the zval to be undef
1 parent 4abadae commit 9c123ac

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Zend/zend_object_handlers.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,10 +1117,9 @@ ZEND_API zval *zend_std_get_property_ptr_ptr(zend_object *zobj, zend_string *nam
11171117
ZSTR_VAL(name));
11181118
retval = &EG(error_zval);
11191119
} else {
1120-
ZVAL_NULL(retval);
11211120
zend_error(E_WARNING, "Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name));
1122-
/* If an error handler unsets the property again just consider it to be NULL again */
1123-
if (UNEXPECTED(Z_TYPE_P(retval) == IS_UNDEF)) {
1121+
/* An error handler may set the property */
1122+
if (EXPECTED(Z_TYPE_P(retval) == IS_UNDEF)) {
11241123
ZVAL_NULL(retval);
11251124
}
11261125
}

0 commit comments

Comments
 (0)