php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login

Patch exception-support-in-__toString for Class/Object related Bug #53648

Patch version 2011-01-04 13:46 UTC

Return to Bug #53648 | Download this patch
Patch Revisions:

Developer: clicky@erebot.net

Index: Zend/zend_object_handlers.c
===================================================================
--- Zend/zend_object_handlers.c	(revision 307076)
+++ Zend/zend_object_handlers.c	(working copy)
@@ -1268,8 +1268,8 @@
 					if (retval) {
 						zval_ptr_dtor(&retval);
 					}
-					zend_error(E_ERROR, "Method %s::__toString() must not throw an exception", ce->name);
-					return FAILURE;
+					zend_throw_exception_internal(NULL TSRMLS_CC);
+					return SUCCESS;
 				}
 				if (Z_TYPE_P(retval) == IS_STRING) {
 					INIT_PZVAL(writeobj);
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 00:01:29 2024 UTC