]> granicus.if.org Git - php/commitdiff
fix #28957
authorStanislav Malyshev <stas@php.net>
Wed, 14 Jul 2004 09:01:58 +0000 (09:01 +0000)
committerStanislav Malyshev <stas@php.net>
Wed, 14 Jul 2004 09:01:58 +0000 (09:01 +0000)
Zend/zend_object_handlers.c

index d7f57a8d96814a3d72c2ec5bad6b04df73111b2a..4beb8df3c9cbb5c14006c88c0cab7b5a3a4fb161 100644 (file)
@@ -381,7 +381,15 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type TSRMLS_DC)
        zval *retval;
        
        if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
+               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);
+               }
                if (!retval) {
                        if (!EG(exception)) {
                                zend_error(E_ERROR, "Undefined offset for object of type %s used as array", ce->name);