From afaf1983135498370d8003c9abe9da8d3ff650dc Mon Sep 17 00:00:00 2001 From: moliata Date: Thu, 18 Jun 2020 15:24:27 +0300 Subject: [PATCH 1/3] Use ZEND_TOSTRING_FUNC_NAME --- Zend/zend_compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 062ed8b025916..8e62917a5a1d4 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -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_ci(decl->name, 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); From b00fe0cfbfda5803f2da22eedf1141fdd57e5d03 Mon Sep 17 00:00:00 2001 From: moliata Date: Thu, 18 Jun 2020 16:18:26 +0300 Subject: [PATCH 2/3] Change decl->name to method_lcname --- Zend/zend_compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 8e62917a5a1d4..6a5d2dcc4411f 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -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, ZEND_TOSTRING_FUNC_NAME) ? IS_STRING : 0); + is_method && zend_string_equals_literal_ci(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); From 543277132e4dc98b5bd179552f694e6a4babfd4c Mon Sep 17 00:00:00 2001 From: moliata Date: Thu, 18 Jun 2020 17:43:40 +0300 Subject: [PATCH 3/3] Use zend_string_equals_literal --- Zend/zend_compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 6a5d2dcc4411f..481bbc877a0af 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -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(method_lcname, ZEND_TOSTRING_FUNC_NAME) ? 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);