From e87ae0b388da138e010bc392276f646122a73c03 Mon Sep 17 00:00:00 2001 From: Felipe Pena Date: Thu, 12 Nov 2009 23:18:04 +0000 Subject: [PATCH] - Fixed bug #49734 (toString must return string value) --- Zend/zend_object_handlers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index 19050061ec..8058c5dbb2 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -1253,7 +1253,7 @@ ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int ty zend_error(E_ERROR, "Method %v::__toString() must not throw an exception", ce->name); return FAILURE; } - if (Z_TYPE_P(retval) == IS_UNICODE) { + if (Z_TYPE_P(retval) == IS_UNICODE || Z_TYPE_P(retval) == IS_STRING) { INIT_PZVAL(writeobj); if (readobj == writeobj) { zval_dtor(readobj); -- 2.40.0