From: Marcus Boerger Date: Thu, 11 Dec 2003 09:56:06 +0000 (+0000) Subject: Handle getter failure and allow to bypass thrown exceptions. X-Git-Tag: php-5.0.0b3RC1~133 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=904373a83086fe66982dcbed8d92c653b9f73907;p=php Handle getter failure and allow to bypass thrown exceptions. --- diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 9d9ab3b247..f3ac745484 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -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--; }