]> granicus.if.org Git - php/commitdiff
Handle getter failure and allow to bypass thrown exceptions.
authorMarcus Boerger <helly@php.net>
Thu, 11 Dec 2003 09:56:06 +0000 (09:56 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 11 Dec 2003 09:56:06 +0000 (09:56 +0000)
Zend/zend_object_handlers.c

index 9d9ab3b247c9a88a0ff48b1d48f5428f40efdc62..f3ac745484f463a27e33785cc1c3400b278eb9e6 100644 (file)
@@ -358,6 +358,12 @@ zval *zend_std_read_dimension(zval *object, zval *offset TSRMLS_DC)
        
        if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
                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);
+                       }
+                       return 0;
+               }
                if (retval->refcount > 0) { /* Should always  be  the case */
                        retval->refcount--;
                }