summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_object_handlers.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index 4beb8df3c9..7965bb0eb3 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -384,12 +384,11 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type TSRMLS_DC)
if(offset == NULL) {
/* [] construct */
zval offset_null;
- ZVAL_NULL(&offset_null);
- zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, &offset_null);
- zval_dtor(&offset_null); /* just in case */
- } else {
- zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, offset);
+ INIT_ZVAL(offset_null);
+ offset = &offset_null;
}
+ zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, offset);
+
if (!retval) {
if (!EG(exception)) {
zend_error(E_ERROR, "Undefined offset for object of type %s used as array", ce->name);