From: Nikita Popov Date: Mon, 22 Jun 2015 13:33:41 +0000 (+0200) Subject: Drop superfluous __toString handling code X-Git-Tag: php-7.0.0alpha2~2^2~12^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=628d4394022d60e519377bb3b2a05722de5472ab;p=php Drop superfluous __toString handling code This is already covered by the cast_object invokation above it. We do not use this kind of fallback in any other casting code anymore. --- diff --git a/Zend/zend_API.c b/Zend/zend_API.c index f49957a7ff..a1f4ef6618 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -458,16 +458,7 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_str_weak(zval *arg, zend_string **dest *dest = Z_STR_P(arg); return 1; } - } - /* Standard PHP objects */ - if (Z_OBJ_HT_P(arg) == &std_object_handlers || !Z_OBJ_HANDLER_P(arg, cast_object)) { - SEPARATE_ZVAL_NOREF(arg); - if (zend_std_cast_object_tostring(arg, arg, IS_STRING) == SUCCESS) { - *dest = Z_STR_P(arg); - return 1; - } - } - if (!Z_OBJ_HANDLER_P(arg, cast_object) && Z_OBJ_HANDLER_P(arg, get)) { + } else if (Z_OBJ_HANDLER_P(arg, get)) { zval rv; zval *z = Z_OBJ_HANDLER_P(arg, get)(arg, &rv);