From: Stanislav Malyshev Date: Thu, 18 Oct 2007 20:44:41 +0000 (+0000) Subject: ws X-Git-Tag: RELEASE_1_3_1~828 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=988d28cc13e82ad791cf4449f839ac1b5df3d3ec;p=php ws --- diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index b71df7c8ec..794d78fd27 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -1130,14 +1130,14 @@ ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int ty case IS_STRING: ce = Z_OBJCE_P(readobj); if (ce->__tostring && - (zend_call_method_with_0_params(&readobj, ce, &ce->__tostring, "__tostring", &retval) || EG(exception))) { - if (EG(exception)) { - if (retval) { - zval_ptr_dtor(&retval); - } + (zend_call_method_with_0_params(&readobj, ce, &ce->__tostring, "__tostring", &retval) || EG(exception))) { + if (EG(exception)) { + if (retval) { + zval_ptr_dtor(&retval); + } zend_error(E_ERROR, "Method %s::__toString() must not throw an exception", ce->name); - return FAILURE; - } + return FAILURE; + } if (Z_TYPE_P(retval) == IS_STRING) { INIT_PZVAL(writeobj); ZVAL_ZVAL(writeobj, retval, 1, 1);