diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 5ae7c7a79340..a2a50e3a79fc 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -2743,7 +2743,7 @@ static void zend_check_magic_method_static( } static void zend_check_magic_method_public( - const zend_class_entry *ce, const zend_function *fptr, int error_type) + const zend_class_entry *ce, const zend_function *fptr) { // TODO: Remove this warning after adding proper visibility handling. if (!(fptr->common.fn_flags & ZEND_ACC_PUBLIC)) { @@ -2786,77 +2786,77 @@ ZEND_API void zend_check_magic_method_implementation(const zend_class_entry *ce, } else if (zend_string_equals_literal(lcname, ZEND_GET_FUNC_NAME)) { zend_check_magic_method_args(1, ce, fptr, error_type); zend_check_magic_method_non_static(ce, fptr, error_type); - zend_check_magic_method_public(ce, fptr, error_type); + zend_check_magic_method_public(ce, fptr); zend_check_magic_method_arg_type(0, ce, fptr, error_type, MAY_BE_STRING); } else if (zend_string_equals_literal(lcname, ZEND_SET_FUNC_NAME)) { zend_check_magic_method_args(2, ce, fptr, error_type); zend_check_magic_method_non_static(ce, fptr, error_type); - zend_check_magic_method_public(ce, fptr, error_type); + zend_check_magic_method_public(ce, fptr); zend_check_magic_method_arg_type(0, ce, fptr, error_type, MAY_BE_STRING); zend_check_magic_method_return_type(ce, fptr, error_type, MAY_BE_VOID); } else if (zend_string_equals_literal(lcname, ZEND_UNSET_FUNC_NAME)) { zend_check_magic_method_args(1, ce, fptr, error_type); zend_check_magic_method_non_static(ce, fptr, error_type); - zend_check_magic_method_public(ce, fptr, error_type); + zend_check_magic_method_public(ce, fptr); zend_check_magic_method_arg_type(0, ce, fptr, error_type, MAY_BE_STRING); zend_check_magic_method_return_type(ce, fptr, error_type, MAY_BE_VOID); } else if (zend_string_equals_literal(lcname, ZEND_ISSET_FUNC_NAME)) { zend_check_magic_method_args(1, ce, fptr, error_type); zend_check_magic_method_non_static(ce, fptr, error_type); - zend_check_magic_method_public(ce, fptr, error_type); + zend_check_magic_method_public(ce, fptr); zend_check_magic_method_arg_type(0, ce, fptr, error_type, MAY_BE_STRING); zend_check_magic_method_return_type(ce, fptr, error_type, MAY_BE_BOOL); } else if (zend_string_equals_literal(lcname, ZEND_CALL_FUNC_NAME)) { zend_check_magic_method_args(2, ce, fptr, error_type); zend_check_magic_method_non_static(ce, fptr, error_type); - zend_check_magic_method_public(ce, fptr, error_type); + zend_check_magic_method_public(ce, fptr); zend_check_magic_method_arg_type(0, ce, fptr, error_type, MAY_BE_STRING); zend_check_magic_method_arg_type(1, ce, fptr, error_type, MAY_BE_ARRAY); } else if (zend_string_equals_literal(lcname, ZEND_CALLSTATIC_FUNC_NAME)) { zend_check_magic_method_args(2, ce, fptr, error_type); zend_check_magic_method_static(ce, fptr, error_type); - zend_check_magic_method_public(ce, fptr, error_type); + zend_check_magic_method_public(ce, fptr); zend_check_magic_method_arg_type(0, ce, fptr, error_type, MAY_BE_STRING); zend_check_magic_method_arg_type(1, ce, fptr, error_type, MAY_BE_ARRAY); } else if (zend_string_equals_literal(lcname, ZEND_TOSTRING_FUNC_NAME)) { zend_check_magic_method_args(0, ce, fptr, error_type); zend_check_magic_method_non_static(ce, fptr, error_type); - zend_check_magic_method_public(ce, fptr, error_type); + zend_check_magic_method_public(ce, fptr); zend_check_magic_method_return_type(ce, fptr, error_type, MAY_BE_STRING); } else if (zend_string_equals_literal(lcname, ZEND_DEBUGINFO_FUNC_NAME)) { zend_check_magic_method_args(0, ce, fptr, error_type); zend_check_magic_method_non_static(ce, fptr, error_type); - zend_check_magic_method_public(ce, fptr, error_type); + zend_check_magic_method_public(ce, fptr); zend_check_magic_method_return_type(ce, fptr, error_type, (MAY_BE_ARRAY | MAY_BE_NULL)); } else if (zend_string_equals_literal(lcname, "__serialize")) { zend_check_magic_method_args(0, ce, fptr, error_type); zend_check_magic_method_non_static(ce, fptr, error_type); - zend_check_magic_method_public(ce, fptr, error_type); + zend_check_magic_method_public(ce, fptr); zend_check_magic_method_return_type(ce, fptr, error_type, MAY_BE_ARRAY); } else if (zend_string_equals_literal(lcname, "__unserialize")) { zend_check_magic_method_args(1, ce, fptr, error_type); zend_check_magic_method_non_static(ce, fptr, error_type); - zend_check_magic_method_public(ce, fptr, error_type); + zend_check_magic_method_public(ce, fptr); zend_check_magic_method_arg_type(0, ce, fptr, error_type, MAY_BE_ARRAY); zend_check_magic_method_return_type(ce, fptr, error_type, MAY_BE_VOID); } else if (zend_string_equals_literal(lcname, "__set_state")) { zend_check_magic_method_args(1, ce, fptr, error_type); zend_check_magic_method_static(ce, fptr, error_type); - zend_check_magic_method_public(ce, fptr, error_type); + zend_check_magic_method_public(ce, fptr); zend_check_magic_method_arg_type(0, ce, fptr, error_type, MAY_BE_ARRAY); zend_check_magic_method_return_type(ce, fptr, error_type, MAY_BE_OBJECT); } else if (zend_string_equals(lcname, ZSTR_KNOWN(ZEND_STR_MAGIC_INVOKE))) { zend_check_magic_method_non_static(ce, fptr, error_type); - zend_check_magic_method_public(ce, fptr, error_type); + zend_check_magic_method_public(ce, fptr); } else if (zend_string_equals(lcname, ZSTR_KNOWN(ZEND_STR_SLEEP))) { zend_check_magic_method_args(0, ce, fptr, error_type); zend_check_magic_method_non_static(ce, fptr, error_type); - zend_check_magic_method_public(ce, fptr, error_type); + zend_check_magic_method_public(ce, fptr); zend_check_magic_method_return_type(ce, fptr, error_type, MAY_BE_ARRAY); } else if (zend_string_equals(lcname, ZSTR_KNOWN(ZEND_STR_WAKEUP))) { zend_check_magic_method_args(0, ce, fptr, error_type); zend_check_magic_method_non_static(ce, fptr, error_type); - zend_check_magic_method_public(ce, fptr, error_type); + zend_check_magic_method_public(ce, fptr); zend_check_magic_method_return_type(ce, fptr, error_type, MAY_BE_VOID); } } diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 764cac3f12af..54bf4c0bf2e6 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -1718,7 +1718,7 @@ static ZEND_COLD bool zend_ast_var_needs_braces(char ch) return ch == '[' || zend_ast_valid_var_char(ch); } -static ZEND_COLD void zend_ast_export_var(smart_str *str, zend_ast *ast, int priority, int indent) +static ZEND_COLD void zend_ast_export_var(smart_str *str, zend_ast *ast, int indent) { if (ast->kind == ZEND_AST_ZVAL) { zval *zv = zend_ast_get_zval(ast); @@ -2417,7 +2417,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio /* 1 child node */ case ZEND_AST_VAR: smart_str_appendc(str, '$'); - zend_ast_export_var(str, ast->child[0], 0, indent); + zend_ast_export_var(str, ast->child[0], indent); break; case ZEND_AST_CONST: zend_ast_export_ns_name(str, ast->child[0], 0, indent); @@ -2532,12 +2532,12 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio case ZEND_AST_NULLSAFE_PROP: zend_ast_export_ex(str, ast->child[0], 0, indent); smart_str_appends(str, ast->kind == ZEND_AST_NULLSAFE_PROP ? "?->" : "->"); - zend_ast_export_var(str, ast->child[1], 0, indent); + zend_ast_export_var(str, ast->child[1], indent); break; case ZEND_AST_STATIC_PROP: zend_ast_export_ns_name(str, ast->child[0], 0, indent); smart_str_appends(str, "::$"); - zend_ast_export_var(str, ast->child[1], 0, indent); + zend_ast_export_var(str, ast->child[1], indent); break; case ZEND_AST_CALL: { zend_ast *left = ast->child[0]; @@ -2857,7 +2857,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio case ZEND_AST_NULLSAFE_METHOD_CALL: zend_ast_export_ex(str, ast->child[0], 0, indent); smart_str_appends(str, ast->kind == ZEND_AST_NULLSAFE_METHOD_CALL ? "?->" : "->"); - zend_ast_export_var(str, ast->child[1], 0, indent); + zend_ast_export_var(str, ast->child[1], indent); smart_str_appendc(str, '('); zend_ast_export_ex(str, ast->child[2], 0, indent); smart_str_appendc(str, ')'); @@ -2865,7 +2865,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio case ZEND_AST_STATIC_CALL: zend_ast_export_ns_name(str, ast->child[0], 0, indent); smart_str_appends(str, "::"); - zend_ast_export_var(str, ast->child[1], 0, indent); + zend_ast_export_var(str, ast->child[1], indent); smart_str_appendc(str, '('); zend_ast_export_ex(str, ast->child[2], 0, indent); smart_str_appendc(str, ')'); @@ -2901,7 +2901,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio zend_ast_export_catch_name_list(str, zend_ast_get_list(ast->child[0]), indent); if (ast->child[1]) { smart_str_appends(str, " $"); - zend_ast_export_var(str, ast->child[1], 0, indent); + zend_ast_export_var(str, ast->child[1], indent); } smart_str_appends(str, ") {\n"); zend_ast_export_stmt(str, ast->child[2], indent + 1);