]> granicus.if.org Git - php/commitdiff
Drop superfluous __toString handling code
authorNikita Popov <nikic@php.net>
Mon, 22 Jun 2015 13:33:41 +0000 (15:33 +0200)
committerNikita Popov <nikic@php.net>
Mon, 22 Jun 2015 13:33:41 +0000 (15:33 +0200)
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.

Zend/zend_API.c

index f49957a7ff836eef7baa9bc8237df7a1ed2a3962..a1f4ef6618d5916413be6f55633ea1ce07875768 100644 (file)
@@ -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);