summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2004-07-14 09:04:13 +0000
committerStanislav Malyshev <stas@php.net>2004-07-14 09:04:13 +0000
commitd673ec01844db598426d80de6d5a7dce03b16037 (patch)
treee7bda9f115fba53ec8aeb9e0423e1f1ffc344dd3
parent28d72ce2fdd88f416b02feaf0900967bacd55ab9 (diff)
downloadphp-git-d673ec01844db598426d80de6d5a7dce03b16037.tar.gz
be consistent with write_dimension
-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);