]> granicus.if.org Git - php/commitdiff
Use ZEND_TOSTRING_FUNC_NAME
authormoliata <ben@moliata.com>
Thu, 18 Jun 2020 12:24:27 +0000 (15:24 +0300)
committerNikita Popov <nikita.ppv@gmail.com>
Thu, 18 Jun 2020 15:06:19 +0000 (17:06 +0200)
Closes GH-5736.

Zend/zend_compile.c

index a34b1d8bea99b01e525a2f7233354ee4e5efb8ba..f65e4a94ec8ef7d78413fbd2ced572881b2b2065 100644 (file)
@@ -6465,7 +6465,7 @@ void zend_compile_func_decl(znode *result, zend_ast *ast, zend_bool toplevel) /*
        }
 
        zend_compile_params(params_ast, return_type_ast,
-               is_method && zend_string_equals_literal_ci(decl->name, "__toString") ? IS_STRING : 0);
+               is_method && zend_string_equals_literal(method_lcname, ZEND_TOSTRING_FUNC_NAME) ? IS_STRING : 0);
        if (CG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) {
                zend_mark_function_as_generator();
                zend_emit_op(NULL, ZEND_GENERATOR_CREATE, NULL, NULL);