diff options
author | Stanislav Malyshev <stas@php.net> | 2004-07-14 09:04:13 +0000 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2004-07-14 09:04:13 +0000 |
commit | d673ec01844db598426d80de6d5a7dce03b16037 (patch) | |
tree | e7bda9f115fba53ec8aeb9e0423e1f1ffc344dd3 | |
parent | 28d72ce2fdd88f416b02feaf0900967bacd55ab9 (diff) | |
download | php-git-d673ec01844db598426d80de6d5a7dce03b16037.tar.gz |
be consistent with write_dimension
-rw-r--r-- | Zend/zend_object_handlers.c | 9 |
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); |