From bf7707a0bd6923e964fc436160d2c74fcda8c627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Sun, 16 Aug 2020 21:49:20 +0200 Subject: [PATCH 1/6] Improve error message for 'Cannot pass parameter by reference' --- UPGRADING | 4 +- Zend/tests/bug72038.phpt | 21 ++++----- Zend/tests/bug73663_2.phpt | 2 +- Zend/tests/bug78154.phpt | 4 +- Zend/tests/bug79783.phpt | 2 +- Zend/tests/closure_019.phpt | 2 +- Zend/tests/errmsg_022.phpt | 2 +- Zend/tests/match/027.phpt | 6 +-- Zend/tests/match/028.phpt | 2 +- .../named_params/cannot_pass_by_ref.phpt | 2 +- Zend/tests/nullsafe_operator/016.phpt | 8 ++-- Zend/tests/variadic/by_ref_error.phpt | 2 +- Zend/zend_API.c | 10 ++--- Zend/zend_execute.h | 4 ++ Zend/zend_execute_API.c | 43 ++++++++++++++++--- Zend/zend_vm_def.h | 9 +++- Zend/zend_vm_execute.h | 10 ++++- ext/opcache/jit/zend_jit_disasm_x86.c | 1 + ext/opcache/jit/zend_jit_helpers.c | 12 ++++++ ext/opcache/jit/zend_jit_x86.dasc | 18 +++----- ext/opcache/tests/optimize_func_calls.phpt | 2 +- ext/pcre/tests/preg_match_all_error3.phpt | 2 +- ext/pdo_mysql/tests/bug_37445.phpt | 2 +- .../tests/array/array_next_error2.phpt | 2 +- ext/standard/tests/array/prev_error3.phpt | 2 +- tests/classes/constants_error_003.phpt | 2 +- tests/lang/passByReference_002.phpt | 2 +- tests/lang/passByReference_010.phpt | 6 +-- 28 files changed, 118 insertions(+), 66 deletions(-) diff --git a/UPGRADING b/UPGRADING index e38f0307c0e8b..3d37c2db2557b 100644 --- a/UPGRADING +++ b/UPGRADING @@ -135,10 +135,10 @@ PHP 8.0 UPGRADE NOTES . Uncaught exceptions now go through "clean shutdown", which means that destructors will be called after an uncaught exception. . Compile time fatal error "Only variables can be passed by reference" has - been delayed until runtime and converted to "Cannot pass parameter by + been delayed until runtime and converted to "Argument cannot be passed by reference" exception. . Some "Only variables should be passed by reference" notices have been - converted to "Cannot pass parameter by reference" exception. + converted to "Argument cannot be passed by reference" exception. . The generated name for anonymous classes has changed. It will now include the name of the first parent or interface: diff --git a/Zend/tests/bug72038.phpt b/Zend/tests/bug72038.phpt index a20642917b473..201fbbf40b298 100644 --- a/Zend/tests/bug72038.phpt +++ b/Zend/tests/bug72038.phpt @@ -6,28 +6,25 @@ Bug #72038 (Function calls with values to a by-ref parameter don't always throw try { test($foo = new stdClass); var_dump($foo); -} catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; +} catch (Error $e) { + echo $e->getMessage() . "\n"; } try { test($bar = 2); var_dump($bar); -} catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; -} -try { - test($baz = &$bar); - var_dump($baz); -} catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; +} catch (Error $e) { + echo $e->getMessage() . "\n"; } +test($baz = &$bar); +var_dump($baz); + function test(&$param) { $param = 1; } ?> --EXPECT-- -Exception: Cannot pass parameter 1 by reference -Exception: Cannot pass parameter 1 by reference +test(): Argument #1 ($param) cannot be passed by reference +test(): Argument #1 ($param) cannot be passed by reference int(1) diff --git a/Zend/tests/bug73663_2.phpt b/Zend/tests/bug73663_2.phpt index 72fb44df89434..31592f255fb67 100644 --- a/Zend/tests/bug73663_2.phpt +++ b/Zend/tests/bug73663_2.phpt @@ -12,7 +12,7 @@ change(list($val) = $array); var_dump($array); ?> --EXPECTF-- -Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %s:%d +Fatal error: Uncaught Error: change(): Argument #1 ($ref) cannot be passed by reference in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/Zend/tests/bug78154.phpt b/Zend/tests/bug78154.phpt index abfbce1434353..6a20af38f571a 100644 --- a/Zend/tests/bug78154.phpt +++ b/Zend/tests/bug78154.phpt @@ -22,5 +22,5 @@ namespace Foo { ?> --EXPECT-- -Exception: Cannot pass parameter 3 by reference -Exception: Cannot pass parameter 3 by reference +Exception: similar_text(): Argument #3 ($percent) cannot be passed by reference +Exception: similar_text(): Argument #3 ($percent) cannot be passed by reference diff --git a/Zend/tests/bug79783.phpt b/Zend/tests/bug79783.phpt index 959e90b06dd22..74d2672e02a00 100644 --- a/Zend/tests/bug79783.phpt +++ b/Zend/tests/bug79783.phpt @@ -5,7 +5,7 @@ Bug #79783: Segfault in php_str_replace_common str_replace("a", "b", "c", strlen("d")); ?> --EXPECTF-- -Fatal error: Uncaught Error: Cannot pass parameter 4 by reference in %s:%d +Fatal error: Uncaught Error: str_replace(): Argument #4 ($replace_count) cannot be passed by reference in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/Zend/tests/closure_019.phpt b/Zend/tests/closure_019.phpt index 05efffb9d4d5f..79341c90640c4 100644 --- a/Zend/tests/closure_019.phpt +++ b/Zend/tests/closure_019.phpt @@ -26,7 +26,7 @@ int(9) Notice: Only variable references should be returned by reference in %sclosure_019.php on line 4 int(81) -Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %s:%d +Fatal error: Uncaught Error: {closure}(): Argument #1 ($x) cannot be passed by reference in %s:%d Stack trace: #0 %s(%d): test() #1 {main} diff --git a/Zend/tests/errmsg_022.phpt b/Zend/tests/errmsg_022.phpt index 068ce147f37f0..3d1eaf3e9945f 100644 --- a/Zend/tests/errmsg_022.phpt +++ b/Zend/tests/errmsg_022.phpt @@ -11,7 +11,7 @@ foo(1); echo "Done\n"; ?> --EXPECTF-- -Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %s:%d +Fatal error: Uncaught Error: foo(): Argument #1 ($var) cannot be passed by reference in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/Zend/tests/match/027.phpt b/Zend/tests/match/027.phpt index 5b87a2c4ea2bc..00dde05bbcaf0 100644 --- a/Zend/tests/match/027.phpt +++ b/Zend/tests/match/027.phpt @@ -30,8 +30,8 @@ main(); usesValue 0 i is 0 -Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %s027.php:20 +Fatal error: Uncaught Error: Test::usesRef(): Argument #1 ($x) cannot be passed by reference in %s:%d Stack trace: -#0 %s027.php(23): main() +#0 %s(%d): main() #1 {main} - thrown in %s027.php on line 20 + thrown in %s on line %d diff --git a/Zend/tests/match/028.phpt b/Zend/tests/match/028.phpt index bbc826a73863e..cfc6a37de2c94 100644 --- a/Zend/tests/match/028.phpt +++ b/Zend/tests/match/028.phpt @@ -34,4 +34,4 @@ try { usesValue 42 usesValue 42 int(42) -Caught Cannot pass parameter 1 by reference +Caught Test::usesRef(): Argument #1 ($x) cannot be passed by reference diff --git a/Zend/tests/named_params/cannot_pass_by_ref.phpt b/Zend/tests/named_params/cannot_pass_by_ref.phpt index 395ee8fa5aa71..20080f9e64b35 100644 --- a/Zend/tests/named_params/cannot_pass_by_ref.phpt +++ b/Zend/tests/named_params/cannot_pass_by_ref.phpt @@ -10,4 +10,4 @@ try { } ?> --EXPECT-- -Cannot pass parameter 2 by reference +test(): Argument #2 ($e) cannot be passed by reference diff --git a/Zend/tests/nullsafe_operator/016.phpt b/Zend/tests/nullsafe_operator/016.phpt index 28bdd08458fcb..4568da19cd486 100644 --- a/Zend/tests/nullsafe_operator/016.phpt +++ b/Zend/tests/nullsafe_operator/016.phpt @@ -29,7 +29,7 @@ test(new Foo()); ?> --EXPECT-- -Cannot pass parameter 1 by reference -Cannot pass parameter 1 by reference -Cannot pass parameter 1 by reference -Cannot pass parameter 1 by reference +set(): Argument #1 ($ref) cannot be passed by reference +set(): Argument #1 ($ref) cannot be passed by reference +set(): Argument #1 ($ref) cannot be passed by reference +set(): Argument #1 ($ref) cannot be passed by reference diff --git a/Zend/tests/variadic/by_ref_error.phpt b/Zend/tests/variadic/by_ref_error.phpt index bc7378785a8ad..3c1e37a3aca43 100644 --- a/Zend/tests/variadic/by_ref_error.phpt +++ b/Zend/tests/variadic/by_ref_error.phpt @@ -9,7 +9,7 @@ test(1); ?> --EXPECTF-- -Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %s:%d +Fatal error: Uncaught Error: test(): Argument #1 cannot be passed by reference in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/Zend/zend_API.c b/Zend/zend_API.c index a8aedeb9643bb..186148da6ad79 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -325,23 +325,23 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_unexpected_extra_named_error(void) static ZEND_COLD void ZEND_FASTCALL zend_argument_error_variadic(zend_class_entry *error_ce, uint32_t arg_num, const char *format, va_list va) /* {{{ */ { - const char *space; - const char *class_name; + char *func_name; const char *arg_name; char *message = NULL; if (EG(exception)) { return; } - class_name = get_active_class_name(&space); + func_name = get_active_function_or_method_name(); arg_name = get_active_function_arg_name(arg_num); zend_vspprintf(&message, 0, format, va); - zend_throw_error(error_ce, "%s%s%s(): Argument #%d%s%s%s %s", - class_name, space, get_active_function_name(), arg_num, + zend_throw_error(error_ce, "%s(): Argument #%d%s%s%s %s", + func_name, arg_num, arg_name ? " ($" : "", arg_name ? arg_name : "", arg_name ? ")" : "", message ); efree(message); + efree(func_name); } /* }}} */ diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 2c581f24cbf4f..50284b7026bd7 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -308,9 +308,13 @@ ZEND_API void ZEND_FASTCALL zend_free_extra_named_params(zend_array *extra_named /* services */ ZEND_API const char *get_active_class_name(const char **space); +ZEND_API const char *get_class_name(const zend_function *func, const char **space); ZEND_API const char *get_active_function_name(void); +ZEND_API const char *get_function_name(const zend_function *func); ZEND_API const char *get_active_function_arg_name(uint32_t arg_num); ZEND_API const char *get_function_arg_name(const zend_function *func, uint32_t arg_num); +ZEND_API char *get_active_function_or_method_name(); +ZEND_API char *get_function_or_method_name(const zend_function *func); ZEND_API const char *zend_get_executed_filename(void); ZEND_API zend_string *zend_get_executed_filename_ex(void); ZEND_API uint32_t zend_get_executed_lineno(void); diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index f1bcc74a58d8a..ceb87b312e58e 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -433,8 +433,6 @@ void shutdown_executor(void) /* {{{ */ /* return class name and "::" or "". */ ZEND_API const char *get_active_class_name(const char **space) /* {{{ */ { - zend_function *func; - if (!zend_is_executing()) { if (space) { *space = ""; @@ -442,7 +440,13 @@ ZEND_API const char *get_active_class_name(const char **space) /* {{{ */ return ""; } - func = EG(current_execute_data)->func; + return get_class_name(EG(current_execute_data)->func, space); +} +/* }}} */ + +/* return class name and "::" or "". */ +ZEND_API const char *get_class_name(const zend_function *func, const char **space) /* {{{ */ +{ switch (func->type) { case ZEND_USER_FUNCTION: case ZEND_INTERNAL_FUNCTION: @@ -465,12 +469,16 @@ ZEND_API const char *get_active_class_name(const char **space) /* {{{ */ ZEND_API const char *get_active_function_name(void) /* {{{ */ { - zend_function *func; - if (!zend_is_executing()) { return NULL; } - func = EG(current_execute_data)->func; + + return get_function_name(EG(current_execute_data)->func); +} +/* }}} */ + +ZEND_API const char *get_function_name(const zend_function *func) /* {{{ */ +{ switch (func->type) { case ZEND_USER_FUNCTION: { zend_string *function_name = func->common.function_name; @@ -491,6 +499,29 @@ ZEND_API const char *get_active_function_name(void) /* {{{ */ } /* }}} */ +ZEND_API char *get_active_function_or_method_name(void) /* {{{ */ +{ + if (!zend_is_executing()) { + return ""; + } + + return get_function_or_method_name(EG(current_execute_data)->func); +} +/* }}} */ + +ZEND_API char *get_function_or_method_name(const zend_function *func) /* {{{ */ +{ + char *name = NULL; + const char *class_name, *space; + + class_name = get_class_name(func, &space); + + zend_spprintf(&name, 0, "%s%s%s", class_name, space, get_function_name(func)); + + return name; +} +/* }}} */ + ZEND_API const char *get_active_function_arg_name(uint32_t arg_num) /* {{{ */ { zend_function *func; diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 9c96328fc4141..ee8347d644751 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -4594,9 +4594,16 @@ ZEND_VM_HOT_HANDLER(65, ZEND_SEND_VAL, CONST|TMPVAR, CONST|UNUSED|NUM) ZEND_VM_COLD_HELPER(zend_cannot_pass_by_ref_helper, ANY, ANY, uint32_t _arg_num, zval *_arg) { USE_OPLINE + char *func_name = get_function_or_method_name(EX(call)->func); + const char *param_name = get_function_arg_name(EX(call)->func, _arg_num); SAVE_OPLINE(); - zend_throw_error(NULL, "Cannot pass parameter %d by reference", _arg_num); + + zend_throw_error(NULL, "%s(): Argument #%d%s%s%s cannot be passed by reference", + func_name, _arg_num, param_name ? " ($" : "", + param_name ? param_name : "", param_name ? ")" : "" + ); + efree(func_name); FREE_OP1(); ZVAL_UNDEF(_arg); HANDLE_EXCEPTION(); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index af6dd7f090c66..b39a408531398 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -2281,9 +2281,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_CREATE_SPEC_HANDLER( static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_cannot_pass_by_ref_helper_SPEC(uint32_t _arg_num, zval *_arg ZEND_OPCODE_HANDLER_ARGS_DC) { USE_OPLINE + zval *arg; + char *func_name = get_function_or_method_name(EX(call)->func); + const char *param_name = get_function_arg_name(EX(call)->func, _arg_num); SAVE_OPLINE(); - zend_throw_error(NULL, "Cannot pass parameter %d by reference", _arg_num); + + zend_throw_error(NULL, "%s(): Argument #%d%s%s%s cannot be passed by reference", + func_name, _arg_num, param_name ? " ($" : "", + param_name ? param_name : "", param_name ? ")" : "" + ); + efree(func_name); FREE_OP(opline->op1_type, opline->op1.var); ZVAL_UNDEF(_arg); HANDLE_EXCEPTION(); diff --git a/ext/opcache/jit/zend_jit_disasm_x86.c b/ext/opcache/jit/zend_jit_disasm_x86.c index bd737fa669732..efd3efcf96dd2 100644 --- a/ext/opcache/jit/zend_jit_disasm_x86.c +++ b/ext/opcache/jit/zend_jit_disasm_x86.c @@ -450,6 +450,7 @@ static int zend_jit_disasm_init(void) REGISTER_HELPER(zend_jit_post_dec_typed_ref); REGISTER_HELPER(zend_jit_assign_op_to_typed_ref); REGISTER_HELPER(zend_jit_only_vars_by_reference); + REGISTER_HELPER(zend_jit_cannot_pass_by_reference); REGISTER_HELPER(zend_jit_invalid_array_access); REGISTER_HELPER(zend_jit_invalid_property_read); REGISTER_HELPER(zend_jit_invalid_property_write); diff --git a/ext/opcache/jit/zend_jit_helpers.c b/ext/opcache/jit/zend_jit_helpers.c index 5b6b0e4b7f6a7..796170c4086fd 100644 --- a/ext/opcache/jit/zend_jit_helpers.c +++ b/ext/opcache/jit/zend_jit_helpers.c @@ -1769,6 +1769,18 @@ static void ZEND_FASTCALL zend_jit_only_vars_by_reference(zval *arg) zend_error(E_NOTICE, "Only variables should be passed by reference"); } +static void ZEND_FASTCALL zend_jit_cannot_pass_by_reference(uint32_t arg_num) +{ + const zend_execute_data *execute_data = EG(current_execute_data); + char *func_name = get_function_or_method_name(EX(call)->func); + const char *param_name = get_function_arg_name(EX(call)->func, arg_num); + + zend_throw_error(NULL, "%s(): Argument #%d%s%s%s cannot be passed by reference", + func_name, arg_num, param_name ? " ($" : "", param_name ? param_name : "", param_name ? ")" : "" + ); + efree(func_name); +} + static void ZEND_FASTCALL zend_jit_invalid_array_access(zval *container) { zend_error(E_WARNING, "Trying to access array offset on value of type %s", zend_zval_type_name(container)); diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index f44a472b95a8a..ab5b94821757c 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -1913,19 +1913,11 @@ static int zend_jit_throw_cannot_pass_by_ref_stub(dasm_State **Dst) |1: | mov RX, r0 |.if X64 - | xor CARG1, CARG1 - | LOAD_ADDR CARG2, "Cannot pass parameter %d by reference" - | mov CARG3d, dword OP:r0->op2.num - | EXT_CALL zend_throw_error, r0 + | mov CARG1d, dword OP:r0->op2.num |.else - | mov r1, dword OP:r0->op2.num - | sub r4, 4 - | push r1 - | push "Cannot pass parameter %d by reference" - | push 0 - | EXT_CALL zend_throw_error, r0 - | add r4, 16 + | mov r1, dword OP:r0->op2.num |.endif + | EXT_CALL zend_jit_cannot_pass_by_reference, r0 | cmp byte OP:RX->op1_type, IS_TMP_VAR | jne >9 |.if X64 @@ -8990,7 +8982,7 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend } if (call_num_args <= func->op_array.num_args) { - if (!trace || (trace->op == ZEND_JIT_TRACE_END + if (!trace || (trace->op == ZEND_JIT_TRACE_END && trace->stop == ZEND_JIT_TRACE_STOP_INTERPRETER)) { uint32_t num_args; @@ -9039,7 +9031,7 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const zend } } } else { - if (!trace || (trace->op == ZEND_JIT_TRACE_END + if (!trace || (trace->op == ZEND_JIT_TRACE_END && trace->stop == ZEND_JIT_TRACE_STOP_INTERPRETER)) { if (func && zend_accel_in_shm(func->op_array.opcodes)) { | LOAD_IP_ADDR (func->op_array.opcodes) diff --git a/ext/opcache/tests/optimize_func_calls.phpt b/ext/opcache/tests/optimize_func_calls.phpt index 5d74eaf8df50e..ac30405ac37c3 100644 --- a/ext/opcache/tests/optimize_func_calls.phpt +++ b/ext/opcache/tests/optimize_func_calls.phpt @@ -128,7 +128,7 @@ Array string(7) "changed" string(7) "changed" -Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %soptimize_func_calls.php:%d +Fatal error: Uncaught Error: ref(): Argument #1 ($b) cannot be passed by reference in %soptimize_func_calls.php:%d Stack trace: #0 {main} thrown in %soptimize_func_calls.php on line %d diff --git a/ext/pcre/tests/preg_match_all_error3.phpt b/ext/pcre/tests/preg_match_all_error3.phpt index b0ad8c3085e02..11427b7c68933 100644 --- a/ext/pcre/tests/preg_match_all_error3.phpt +++ b/ext/pcre/tests/preg_match_all_error3.phpt @@ -17,7 +17,7 @@ echo "Done"; --EXPECTF-- *** Testing preg_match_all() : error conditions *** -Fatal error: Uncaught Error: Cannot pass parameter 3 by reference in %s:%d +Fatal error: Uncaught Error: preg_match_all(): Argument #3 ($subpatterns) cannot be passed by reference in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/ext/pdo_mysql/tests/bug_37445.phpt b/ext/pdo_mysql/tests/bug_37445.phpt index d43bedd619e73..b3251e335a953 100644 --- a/ext/pdo_mysql/tests/bug_37445.phpt +++ b/ext/pdo_mysql/tests/bug_37445.phpt @@ -17,7 +17,7 @@ $stmt = $db->prepare("SELECT 1"); $stmt->bindParam(':a', 'b'); ?> --EXPECTF-- -Fatal error: Uncaught Error: Cannot pass parameter 2 by reference in %sbug_37445.php:%d +Fatal error: Uncaught Error: PDOStatement::bindParam(): Argument #2 ($param) cannot be passed by reference in %sbug_37445.php:%d Stack trace: #0 {main} thrown in %sbug_37445.php on line %d diff --git a/ext/standard/tests/array/array_next_error2.phpt b/ext/standard/tests/array/array_next_error2.phpt index 75aa778859152..e9df624e0e3e4 100644 --- a/ext/standard/tests/array/array_next_error2.phpt +++ b/ext/standard/tests/array/array_next_error2.phpt @@ -8,7 +8,7 @@ function f() { var_dump(next(array(1, 2))); ?> --EXPECTF-- -Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %s:%d +Fatal error: Uncaught Error: next(): Argument #1 ($arg) cannot be passed by reference in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/ext/standard/tests/array/prev_error3.phpt b/ext/standard/tests/array/prev_error3.phpt index 35f356746717b..7777527f16ab4 100644 --- a/ext/standard/tests/array/prev_error3.phpt +++ b/ext/standard/tests/array/prev_error3.phpt @@ -10,7 +10,7 @@ prev - ensure we cannot pass a temporary var_dump(prev(array(1, 2))); ?> --EXPECTF-- -Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %s:%d +Fatal error: Uncaught Error: prev(): Argument #1 ($arg) cannot be passed by reference in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/tests/classes/constants_error_003.phpt b/tests/classes/constants_error_003.phpt index a0ee23506be90..afc199555b143 100644 --- a/tests/classes/constants_error_003.phpt +++ b/tests/classes/constants_error_003.phpt @@ -16,7 +16,7 @@ Basic class support - attempting to pass a class constant by reference. var_dump(aclass::myConst); ?> --EXPECTF-- -Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %s:%d +Fatal error: Uncaught Error: f(): Argument #1 ($a) cannot be passed by reference in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/tests/lang/passByReference_002.phpt b/tests/lang/passByReference_002.phpt index 2c3de8879aa8c..fbb6bd2a6c5f0 100644 --- a/tests/lang/passByReference_002.phpt +++ b/tests/lang/passByReference_002.phpt @@ -12,7 +12,7 @@ f(2); ?> --EXPECTF-- -Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in %s:%d +Fatal error: Uncaught Error: f(): Argument #1 ($arg1) cannot be passed by reference in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/tests/lang/passByReference_010.phpt b/tests/lang/passByReference_010.phpt index 24b108a17420c..d6709ff84ea2f 100644 --- a/tests/lang/passByReference_010.phpt +++ b/tests/lang/passByReference_010.phpt @@ -50,11 +50,11 @@ try { ?> --EXPECT-- ---> Pass constant assignment by reference: -Exception: Cannot pass parameter 1 by reference +Exception: f(): Argument #1 ($a) cannot be passed by reference ---> Pass variable assignment by reference: -Exception: Cannot pass parameter 1 by reference +Exception: f(): Argument #1 ($a) cannot be passed by reference ---> Pass reference assignment by reference: @@ -63,4 +63,4 @@ string(9) "a.changed" ---> Pass concat assignment by reference: -Exception: Cannot pass parameter 1 by reference +Exception: f(): Argument #1 ($a) cannot be passed by reference From b948bcab371accf9c0d21532ed5c186da8f50324 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Mon, 17 Aug 2020 09:49:22 +0200 Subject: [PATCH 2/6] Improve ArgumentCountError error message --- Zend/tests/bug46106.phpt | 2 +- Zend/tests/bug51827.phpt | 2 +- .../argument_count_incorrect_internal.phpt | 2 +- ...ument_count_incorrect_internal_strict.phpt | 2 +- Zend/zend_API.c | 40 +++++++++---------- .../tests/DateTimeZone_construct_error.phpt | 2 +- ext/date/tests/DateTime_construct_error.phpt | 2 +- ext/date/tests/mktime_error.phpt | 4 +- .../tests/DOMAttr_construct_error_001.phpt | 2 +- .../DOMCDATASection_construct_error_001.phpt | 2 +- .../tests/DOMComment_construct_error_001.phpt | 2 +- ext/fileinfo/tests/bug61173.phpt | 2 +- .../tests/breakiter___construct_error.phpt | 4 +- .../tests/calendar_before_after_error.phpt | 12 +++--- ext/intl/tests/calendar_equals_error.phpt | 4 +- .../tests/calendar_fieldDifference_error.phpt | 4 +- ext/intl/tests/calendar_getLocale_error.phpt | 2 +- ...r_get_getActualMaximum_Minumum_error2.phpt | 12 +++--- .../tests/calendar_isEquivalentTo_error.phpt | 4 +- .../tests/calendar_setTimeZone_error.phpt | 6 +-- ext/intl/tests/calendar_setTime_error.phpt | 2 +- ext/intl/tests/calendar_set_error.phpt | 2 +- ext/intl/tests/formatter_fail.phpt | 6 +-- ext/intl/tests/msgfmt_fail2.phpt | 12 +++--- ext/mysqli/tests/mysqli_fetch_object_oo.phpt | 2 +- ext/phar/tests/002.phpt | 2 +- ext/phar/tests/badparameters.phpt | 8 ++-- ext/phar/tests/bug60261.phpt | 2 +- .../ReflectionClass_constructor_002.phpt | 4 +- .../tests/ReflectionClass_getMethod_002.phpt | 4 +- .../ReflectionClass_getProperty_002.phpt | 4 +- ...ctionClass_getStaticPropertyValue_002.phpt | 4 +- ...flectionClass_implementsInterface_001.phpt | 4 +- .../ReflectionClass_isSubclassOf_002.phpt | 4 +- ...ctionClass_setStaticPropertyValue_002.phpt | 6 +-- ...ReflectionExtension_constructor_error.phpt | 6 +-- .../ReflectionFunction_construct.001.phpt | 4 +- .../tests/ReflectionMethod_006.phpt | 4 +- .../ReflectionMethod_constructor_error2.phpt | 6 +-- .../tests/ReflectionMethod_invoke_basic.phpt | 2 +- .../ReflectionObject_isSubclassOf.002.phpt | 4 +- ...nParameter_invalidMethodInConstructor.phpt | 2 +- .../tests/ReflectionProperty_error.phpt | 6 +-- .../ReflectionProperty_getValue_error.phpt | 2 +- .../session_set_save_handler_class_012.phpt | 2 +- ext/soap/tests/bugs/bug31422.phpt | 2 +- ext/sockets/tests/socket_connect_params.phpt | 2 +- ext/sodium/tests/bug78114.phpt | 2 +- .../tests/CallbackFilterIteratorTest-002.phpt | 4 +- .../tests/arrayObject___construct_error2.phpt | 2 +- .../arrayObject_exchangeArray_basic3.phpt | 2 +- ext/spl/tests/arrayObject_uasort_error1.phpt | 4 +- ext/spl/tests/arrayObject_uksort_error1.phpt | 4 +- ext/spl/tests/iterator_056.phpt | 12 +++--- ext/spl/tests/iterator_062.phpt | 2 +- .../tests/recursive_tree_iterator_002.phpt | 2 +- ext/spl/tests/spl_004.phpt | 2 +- .../spl_iterator_iterator_constructor.phpt | 2 +- ext/sqlite3/tests/sqlite3_02_open.phpt | 2 +- .../tests/array/array_filter_variation10.phpt | 2 +- ext/standard/tests/array/array_map_error.phpt | 2 +- .../tests/array/array_map_variation12.phpt | 2 +- .../tests/array/array_walk_error2.phpt | 2 +- .../array/array_walk_recursive_error2.phpt | 2 +- .../tests/password/password_hash_error.phpt | 2 +- .../password/password_needs_rehash_error.phpt | 2 +- .../tests/password/password_verify_error.phpt | 2 +- .../tests/random/random_bytes_error.phpt | 2 +- .../tests/random/random_int_error.phpt | 4 +- ext/standard/tests/strings/chr_error.phpt | 4 +- ext/standard/tests/strings/fprintf_error.phpt | 6 +-- ext/standard/tests/strings/printf.phpt | 2 +- ext/standard/tests/strings/printf_64bit.phpt | 2 +- ext/standard/tests/strings/printf_error.phpt | 2 +- ext/standard/tests/strings/sprintf_error.phpt | 4 +- .../tests/strings/vfprintf_error1.phpt | 4 +- tests/output/ob_014.phpt | 2 +- tests/output/ob_015.phpt | 2 +- 78 files changed, 155 insertions(+), 155 deletions(-) diff --git a/Zend/tests/bug46106.phpt b/Zend/tests/bug46106.phpt index 525c4df6c5d96..a8658cb295e5d 100644 --- a/Zend/tests/bug46106.phpt +++ b/Zend/tests/bug46106.phpt @@ -23,5 +23,5 @@ try { ?> DONE --EXPECT-- -str_pad() expects at least 2 parameters, 1 given +str_pad(): At least 2 arguments are expected, 1 given DONE diff --git a/Zend/tests/bug51827.phpt b/Zend/tests/bug51827.phpt index 1a2d9bdf39ca4..79b17c6773771 100644 --- a/Zend/tests/bug51827.phpt +++ b/Zend/tests/bug51827.phpt @@ -16,7 +16,7 @@ register_shutdown_function('exploDe'); --EXPECT-- int(1) -Fatal error: Uncaught ArgumentCountError: explode() expects at least 2 parameters, 0 given in [no active file]:0 +Fatal error: Uncaught ArgumentCountError: explode(): At least 2 arguments are expected, 0 given in [no active file]:0 Stack trace: #0 [internal function]: explode() #1 {main} diff --git a/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt b/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt index 5d5235888f39e..16f9a7e65b63d 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt @@ -9,4 +9,4 @@ try { } ?> --EXPECT-- -substr() expects at least 2 parameters, 1 given +substr(): At least 2 arguments are expected, 1 given diff --git a/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt b/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt index 66b651737915d..e77fc74c5d365 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt @@ -19,6 +19,6 @@ try { ?> --EXPECT-- ArgumentCountError -substr() expects at least 2 parameters, 1 given +substr(): At least 2 arguments are expected, 1 given ArgumentCountError At least 2 parameters are required, 1 given diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 186148da6ad79..fd0d3499208d0 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -198,18 +198,18 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_none_error(void) /* ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(uint32_t min_num_args, uint32_t max_num_args) /* {{{ */ { uint32_t num_args = ZEND_CALL_NUM_ARGS(EG(current_execute_data)); - zend_function *active_function = EG(current_execute_data)->func; - const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : ""; + char *func_name = get_active_function_or_method_name(); zend_argument_count_error( - "%s%s%s() expects %s %d parameter%s, %d given", - class_name, \ - class_name[0] ? "::" : "", \ - ZSTR_VAL(active_function->common.function_name), - min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most", - num_args < min_num_args ? min_num_args : max_num_args, - (num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s", - num_args); + "%s(): %s %d argument%s %s expected, %d given", + func_name, min_num_args == max_num_args ? "Exactly" : num_args < min_num_args ? "At least" : "At most", + num_args < min_num_args ? min_num_args : max_num_args, + (num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s", + (num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "is" : "are", + num_args + ); + + efree(func_name); } /* }}} */ @@ -1005,16 +1005,16 @@ static zend_result zend_parse_va_args(uint32_t num_args, const char *type_spec, if (num_args < min_num_args || num_args > max_num_args) { if (!(flags & ZEND_PARSE_PARAMS_QUIET)) { - zend_function *active_function = EG(current_execute_data)->func; - const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : ""; - zend_argument_count_error("%s%s%s() expects %s %d parameter%s, %d given", - class_name, - class_name[0] ? "::" : "", - ZSTR_VAL(active_function->common.function_name), - min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most", - num_args < min_num_args ? min_num_args : max_num_args, - (num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s", - num_args); + char *func_name = get_active_function_or_method_name(); + zend_argument_count_error("%s(): %s %d argument%s %s expected, %d given", + func_name, min_num_args == max_num_args ? "Exactly" : num_args < min_num_args ? "At least" : "At most", + num_args < min_num_args ? min_num_args : max_num_args, + (num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s", + (num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "is" : "are", + num_args + ); + + efree(func_name); } return FAILURE; } diff --git a/ext/date/tests/DateTimeZone_construct_error.phpt b/ext/date/tests/DateTimeZone_construct_error.phpt index 00142dbe3a1f6..711349ff5748e 100644 --- a/ext/date/tests/DateTimeZone_construct_error.phpt +++ b/ext/date/tests/DateTimeZone_construct_error.phpt @@ -21,4 +21,4 @@ try { *** Testing DateTimeZone() : error conditions *** -- Testing new DateTimeZone() with more than expected no. of arguments -- -DateTimeZone::__construct() expects exactly 1 parameter, 2 given +DateTimeZone::__construct(): Exactly 1 argument is expected, 2 given diff --git a/ext/date/tests/DateTime_construct_error.phpt b/ext/date/tests/DateTime_construct_error.phpt index b033eadaeb530..16cf16216d290 100644 --- a/ext/date/tests/DateTime_construct_error.phpt +++ b/ext/date/tests/DateTime_construct_error.phpt @@ -22,4 +22,4 @@ try { *** Testing date_create() : error conditions *** -- Testing new DateTime() with more than expected no. of arguments -- -DateTime::__construct() expects at most 2 parameters, 3 given +DateTime::__construct(): At most 2 arguments are expected, 3 given diff --git a/ext/date/tests/mktime_error.phpt b/ext/date/tests/mktime_error.phpt index f7cc4565bebef..e567838c499fa 100644 --- a/ext/date/tests/mktime_error.phpt +++ b/ext/date/tests/mktime_error.phpt @@ -33,7 +33,7 @@ try { *** Testing mktime() : error conditions *** -- Testing mktime() function with Zero arguments -- -mktime() expects at least 1 parameter, 0 given +mktime(): At least 1 argument is expected, 0 given -- Testing mktime() function with more than expected no. of arguments -- -mktime() expects at most 6 parameters, 7 given +mktime(): At most 6 arguments are expected, 7 given diff --git a/ext/dom/tests/DOMAttr_construct_error_001.phpt b/ext/dom/tests/DOMAttr_construct_error_001.phpt index fbe2512c1d6ab..3540862c31ad0 100644 --- a/ext/dom/tests/DOMAttr_construct_error_001.phpt +++ b/ext/dom/tests/DOMAttr_construct_error_001.phpt @@ -14,4 +14,4 @@ try { } ?> --EXPECT-- -DOMAttr::__construct() expects at least 1 parameter, 0 given +DOMAttr::__construct(): At least 1 argument is expected, 0 given diff --git a/ext/dom/tests/DOMCDATASection_construct_error_001.phpt b/ext/dom/tests/DOMCDATASection_construct_error_001.phpt index ab7149cd879d0..61a63745de42e 100644 --- a/ext/dom/tests/DOMCDATASection_construct_error_001.phpt +++ b/ext/dom/tests/DOMCDATASection_construct_error_001.phpt @@ -14,4 +14,4 @@ Nic Rosental nicrosental@gmail.com } ?> --EXPECT-- -DOMCdataSection::__construct() expects exactly 1 parameter, 0 given +DOMCdataSection::__construct(): Exactly 1 argument is expected, 0 given diff --git a/ext/dom/tests/DOMComment_construct_error_001.phpt b/ext/dom/tests/DOMComment_construct_error_001.phpt index e02c2a97a2395..9f508429a9b59 100644 --- a/ext/dom/tests/DOMComment_construct_error_001.phpt +++ b/ext/dom/tests/DOMComment_construct_error_001.phpt @@ -14,4 +14,4 @@ try { } ?> --EXPECT-- -DOMComment::__construct() expects at most 1 parameter, 2 given +DOMComment::__construct(): At most 1 argument is expected, 2 given diff --git a/ext/fileinfo/tests/bug61173.phpt b/ext/fileinfo/tests/bug61173.phpt index 10277ba608194..6f6e8177961e0 100644 --- a/ext/fileinfo/tests/bug61173.phpt +++ b/ext/fileinfo/tests/bug61173.phpt @@ -15,4 +15,4 @@ try { } ?> --EXPECT-- -finfo::__construct() expects at most 2 parameters, 3 given +finfo::__construct(): At most 2 arguments are expected, 3 given diff --git a/ext/intl/tests/breakiter___construct_error.phpt b/ext/intl/tests/breakiter___construct_error.phpt index 7272d8c16b71c..f8ddadb53740b 100644 --- a/ext/intl/tests/breakiter___construct_error.phpt +++ b/ext/intl/tests/breakiter___construct_error.phpt @@ -46,9 +46,9 @@ try { --EXPECTF-- Exception: IntlRuleBasedBreakIterator::__construct(): unable to create RuleBasedBreakIterator from rules (parse error on line 1, offset 31) in %s on line %d -Exception: IntlRuleBasedBreakIterator::__construct() expects at least 1 parameter, 0 given in %s on line %d +Exception: IntlRuleBasedBreakIterator::__construct(): At least 1 argument is expected, 0 given in %s on line %d -Exception: IntlRuleBasedBreakIterator::__construct() expects at most 2 parameters, 3 given in %s on line %d +Exception: IntlRuleBasedBreakIterator::__construct(): At most 2 arguments are expected, 3 given in %s on line %d Exception: IntlRuleBasedBreakIterator::__construct(): Argument #2 ($areCompiled) must be of type bool, array given in %s on line %d diff --git a/ext/intl/tests/calendar_before_after_error.phpt b/ext/intl/tests/calendar_before_after_error.phpt index be1f01b9279bb..c0bd8a61bb75d 100644 --- a/ext/intl/tests/calendar_before_after_error.phpt +++ b/ext/intl/tests/calendar_before_after_error.phpt @@ -62,18 +62,18 @@ try { } ?> --EXPECT-- -error: 0, IntlCalendar::after() expects exactly 1 parameter, 0 given +error: 0, IntlCalendar::after(): Exactly 1 argument is expected, 0 given -error: 0, IntlCalendar::before() expects exactly 1 parameter, 0 given +error: 0, IntlCalendar::before(): Exactly 1 argument is expected, 0 given error: 0, IntlCalendar::after(): Argument #1 ($calendar) must be of type IntlCalendar, int given error: 0, IntlCalendar::before(): Argument #1 ($calendar) must be of type IntlCalendar, int given -error: 0, IntlCalendar::after() expects exactly 1 parameter, 2 given +error: 0, IntlCalendar::after(): Exactly 1 argument is expected, 2 given -error: 0, IntlCalendar::before() expects exactly 1 parameter, 2 given +error: 0, IntlCalendar::before(): Exactly 1 argument is expected, 2 given -error: 0, intlcal_after() expects exactly 2 parameters, 1 given +error: 0, intlcal_after(): Exactly 2 arguments are expected, 1 given -error: 0, intlcal_before() expects exactly 2 parameters, 1 given +error: 0, intlcal_before(): Exactly 2 arguments are expected, 1 given diff --git a/ext/intl/tests/calendar_equals_error.phpt b/ext/intl/tests/calendar_equals_error.phpt index 41a7d1723848a..f25acd1035ced 100644 --- a/ext/intl/tests/calendar_equals_error.phpt +++ b/ext/intl/tests/calendar_equals_error.phpt @@ -46,11 +46,11 @@ try { } ?> --EXPECT-- -error: 0, IntlCalendar::equals() expects exactly 1 parameter, 0 given +error: 0, IntlCalendar::equals(): Exactly 1 argument is expected, 0 given error: 0, IntlCalendar::equals(): Argument #1 ($calendar) must be of type IntlCalendar, stdClass given -error: 0, IntlCalendar::equals() expects exactly 1 parameter, 2 given +error: 0, IntlCalendar::equals(): Exactly 1 argument is expected, 2 given error: 0, intlcal_equals(): Argument #2 ($calendar) must be of type IntlCalendar, array given diff --git a/ext/intl/tests/calendar_fieldDifference_error.phpt b/ext/intl/tests/calendar_fieldDifference_error.phpt index a7b83acdd651d..0ce5a1c8073dd 100644 --- a/ext/intl/tests/calendar_fieldDifference_error.phpt +++ b/ext/intl/tests/calendar_fieldDifference_error.phpt @@ -27,11 +27,11 @@ try { var_dump(intlcal_field_difference(1, 0, 1)); ?> --EXPECTF-- -IntlCalendar::fieldDifference() expects exactly 2 parameters, 3 given +IntlCalendar::fieldDifference(): Exactly 2 arguments are expected, 3 given Warning: IntlCalendar::fieldDifference(): intlcal_field_difference: Call to ICU method has failed in %s on line %d bool(false) -intlcal_field_difference() expects exactly 3 parameters, 4 given +intlcal_field_difference(): Exactly 3 arguments are expected, 4 given Fatal error: Uncaught TypeError: intlcal_field_difference(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d Stack trace: diff --git a/ext/intl/tests/calendar_getLocale_error.phpt b/ext/intl/tests/calendar_getLocale_error.phpt index 7171b4934b4ce..90adb903a40d7 100644 --- a/ext/intl/tests/calendar_getLocale_error.phpt +++ b/ext/intl/tests/calendar_getLocale_error.phpt @@ -13,7 +13,7 @@ ini_set("intl.error_level", E_WARNING); var_dump(intlcal_get_locale(1)); ?> --EXPECTF-- -Fatal error: Uncaught ArgumentCountError: intlcal_get_locale() expects exactly 2 parameters, 1 given in %s:%d +Fatal error: Uncaught ArgumentCountError: intlcal_get_locale(): Exactly 2 arguments are expected, 1 given in %s:%d Stack trace: #0 %s(%d): intlcal_get_locale(1) #1 {main} diff --git a/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt b/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt index d3fadb16ed230..fe377be47d2e6 100644 --- a/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt +++ b/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt @@ -76,15 +76,15 @@ try { } ?> --EXPECT-- -ArgumentCountError: 0, intlcal_get() expects exactly 2 parameters, 1 given -ArgumentCountError: 0, intlcal_get_actual_maximum() expects exactly 2 parameters, 1 given -ArgumentCountError: 0, intlcal_get_actual_minimum() expects exactly 2 parameters, 1 given +ArgumentCountError: 0, intlcal_get(): Exactly 2 arguments are expected, 1 given +ArgumentCountError: 0, intlcal_get_actual_maximum(): Exactly 2 arguments are expected, 1 given +ArgumentCountError: 0, intlcal_get_actual_minimum(): Exactly 2 arguments are expected, 1 given ValueError: 0, intlcal_get(): Argument #2 ($field) must be a valid field ValueError: 0, intlcal_get_actual_maximum(): Argument #2 ($field) must be a valid field ValueError: 0, intlcal_get_actual_minimum(): Argument #2 ($field) must be a valid field TypeError: 0, intlcal_get(): Argument #2 ($field) must be of type int, string given TypeError: 0, intlcal_get_actual_maximum(): Argument #2 ($field) must be of type int, string given TypeError: 0, intlcal_get_actual_minimum(): Argument #2 ($field) must be of type int, string given -ArgumentCountError: 0, intlcal_get() expects exactly 2 parameters, 1 given -ArgumentCountError: 0, intlcal_get_actual_maximum() expects exactly 2 parameters, 1 given -ArgumentCountError: 0, intlcal_get_actual_minimum() expects exactly 2 parameters, 1 given +ArgumentCountError: 0, intlcal_get(): Exactly 2 arguments are expected, 1 given +ArgumentCountError: 0, intlcal_get_actual_maximum(): Exactly 2 arguments are expected, 1 given +ArgumentCountError: 0, intlcal_get_actual_minimum(): Exactly 2 arguments are expected, 1 given diff --git a/ext/intl/tests/calendar_isEquivalentTo_error.phpt b/ext/intl/tests/calendar_isEquivalentTo_error.phpt index 1dc36c2a2446f..05b13d54d92b5 100644 --- a/ext/intl/tests/calendar_isEquivalentTo_error.phpt +++ b/ext/intl/tests/calendar_isEquivalentTo_error.phpt @@ -52,11 +52,11 @@ try { --EXPECT-- error: 0, IntlCalendar::isEquivalentTo(): Argument #1 ($calendar) must be of type IntlCalendar, int given -error: 0, IntlCalendar::isEquivalentTo() expects exactly 1 parameter, 2 given +error: 0, IntlCalendar::isEquivalentTo(): Exactly 1 argument is expected, 2 given error: 0, IntlCalendar::isEquivalentTo(): Argument #1 ($calendar) must be of type IntlCalendar, int given -error: 0, intlcal_is_equivalent_to() expects exactly 2 parameters, 1 given +error: 0, intlcal_is_equivalent_to(): Exactly 2 arguments are expected, 1 given error: 0, intlcal_is_equivalent_to(): Argument #2 ($calendar) must be of type IntlCalendar, int given diff --git a/ext/intl/tests/calendar_setTimeZone_error.phpt b/ext/intl/tests/calendar_setTimeZone_error.phpt index 4d3e7fdc6d933..4c7bd40961598 100644 --- a/ext/intl/tests/calendar_setTimeZone_error.phpt +++ b/ext/intl/tests/calendar_setTimeZone_error.phpt @@ -42,10 +42,10 @@ try{ } ?> --EXPECT-- -error: 0, IntlCalendar::setTimeZone() expects exactly 1 parameter, 2 given +error: 0, IntlCalendar::setTimeZone(): Exactly 1 argument is expected, 2 given -error: 0, IntlCalendar::setTimeZone() expects exactly 1 parameter, 0 given +error: 0, IntlCalendar::setTimeZone(): Exactly 1 argument is expected, 0 given -error: 0, intlcal_set_time_zone() expects exactly 2 parameters, 3 given +error: 0, intlcal_set_time_zone(): Exactly 2 arguments are expected, 3 given error: 0, intlcal_set_time_zone(): Argument #1 ($calendar) must be of type IntlCalendar, int given diff --git a/ext/intl/tests/calendar_setTime_error.phpt b/ext/intl/tests/calendar_setTime_error.phpt index 8d4f726081481..6e48fe6df4622 100644 --- a/ext/intl/tests/calendar_setTime_error.phpt +++ b/ext/intl/tests/calendar_setTime_error.phpt @@ -13,7 +13,7 @@ ini_set("intl.error_level", E_WARNING); var_dump(intlcal_set_time(1)); ?> --EXPECTF-- -Fatal error: Uncaught ArgumentCountError: intlcal_set_time() expects exactly 2 parameters, 1 given in %s:%d +Fatal error: Uncaught ArgumentCountError: intlcal_set_time(): Exactly 2 arguments are expected, 1 given in %s:%d Stack trace: #0 %s(%d): intlcal_set_time(1) #1 {main} diff --git a/ext/intl/tests/calendar_set_error.phpt b/ext/intl/tests/calendar_set_error.phpt index bd44356f61308..7f3e71ede565e 100644 --- a/ext/intl/tests/calendar_set_error.phpt +++ b/ext/intl/tests/calendar_set_error.phpt @@ -43,7 +43,7 @@ try { } ?> --EXPECT-- -IntlCalendar::set() expects at most 6 parameters, 7 given +IntlCalendar::set(): At most 6 arguments are expected, 7 given IntlCalendar::set() has no variant with exactly 4 parameters IntlCalendar::set(): Argument #1 ($year) must be a valid field intlcal_set(): Argument #2 ($year) must be a valid field diff --git a/ext/intl/tests/formatter_fail.phpt b/ext/intl/tests/formatter_fail.phpt index 15981178ac5b5..e08500089abc0 100644 --- a/ext/intl/tests/formatter_fail.phpt +++ b/ext/intl/tests/formatter_fail.phpt @@ -95,13 +95,13 @@ foreach($args as $arg) { ?> --EXPECTF-- -ArgumentCountError: NumberFormatter::__construct() expects at least 2 parameters, 0 given in %s on line %d +ArgumentCountError: NumberFormatter::__construct(): At least 2 arguments are expected, 0 given in %s on line %d 'U_ZERO_ERROR' -ArgumentCountError: numfmt_create() expects at least 2 parameters, 0 given in %s on line %d +ArgumentCountError: numfmt_create(): At least 2 arguments are expected, 0 given in %s on line %d 'U_ZERO_ERROR' -ArgumentCountError: NumberFormatter::create() expects at least 2 parameters, 0 given in %s on line %d +ArgumentCountError: NumberFormatter::create(): At least 2 arguments are expected, 0 given in %s on line %d 'U_ZERO_ERROR' Error: NumberFormatter object is already constructed in %s on line %d diff --git a/ext/intl/tests/msgfmt_fail2.phpt b/ext/intl/tests/msgfmt_fail2.phpt index b53e70e8ea280..87a505832a5b7 100644 --- a/ext/intl/tests/msgfmt_fail2.phpt +++ b/ext/intl/tests/msgfmt_fail2.phpt @@ -108,22 +108,22 @@ foreach($args as $arg) { ?> --EXPECTF-- -ArgumentCountError: MessageFormatter::__construct() expects exactly 2 parameters, 0 given in %s on line %d +ArgumentCountError: MessageFormatter::__construct(): Exactly 2 arguments are expected, 0 given in %s on line %d 'U_ZERO_ERROR' -ArgumentCountError: msgfmt_create() expects exactly 2 parameters, 0 given in %s on line %d +ArgumentCountError: msgfmt_create(): Exactly 2 arguments are expected, 0 given in %s on line %d 'U_ZERO_ERROR' -ArgumentCountError: MessageFormatter::create() expects exactly 2 parameters, 0 given in %s on line %d +ArgumentCountError: MessageFormatter::create(): Exactly 2 arguments are expected, 0 given in %s on line %d 'U_ZERO_ERROR' -ArgumentCountError: MessageFormatter::__construct() expects exactly 2 parameters, 1 given in %s on line %d +ArgumentCountError: MessageFormatter::__construct(): Exactly 2 arguments are expected, 1 given in %s on line %d 'U_ZERO_ERROR' -ArgumentCountError: msgfmt_create() expects exactly 2 parameters, 1 given in %s on line %d +ArgumentCountError: msgfmt_create(): Exactly 2 arguments are expected, 1 given in %s on line %d 'U_ZERO_ERROR' -ArgumentCountError: MessageFormatter::create() expects exactly 2 parameters, 1 given in %s on line %d +ArgumentCountError: MessageFormatter::create(): Exactly 2 arguments are expected, 1 given in %s on line %d 'U_ZERO_ERROR' IntlException: Constructor failed in %s on line %d diff --git a/ext/mysqli/tests/mysqli_fetch_object_oo.phpt b/ext/mysqli/tests/mysqli_fetch_object_oo.phpt index d67c3fe6a8a76..c5d6430a35606 100644 --- a/ext/mysqli/tests/mysqli_fetch_object_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_object_oo.phpt @@ -134,7 +134,7 @@ require_once('skipifconnectfailure.inc'); --EXPECTF-- mysqli object is not fully initialized [0] Object of class mysqli could not be converted to string in %s on line %d -[0] mysqli_result::fetch_object() expects at most 2 parameters, 3 given in %s on line %d +[0] mysqli_result::fetch_object(): At most 2 arguments are expected, 3 given in %s on line %d [0] mysqli_result::fetch_object(): Argument #2 ($params) must be of type array, null given in %s on line %d Exception: Too few arguments to function mysqli_fetch_object_construct::__construct(), 1 passed and exactly 2 expected NULL diff --git a/ext/phar/tests/002.phpt b/ext/phar/tests/002.phpt index cfd8cc5e66eea..947295ebccf40 100644 --- a/ext/phar/tests/002.phpt +++ b/ext/phar/tests/002.phpt @@ -17,5 +17,5 @@ try { } __HALT_COMPILER(); ?> --EXPECTF-- -Phar::mapPhar() expects at most 2 parameters, 3 given +Phar::mapPhar(): At most 2 arguments are expected, 3 given internal corruption of phar "%s002.php" (truncated manifest at manifest length) diff --git a/ext/phar/tests/badparameters.phpt b/ext/phar/tests/badparameters.phpt index e06472233cb40..187bb245c6d2d 100644 --- a/ext/phar/tests/badparameters.phpt +++ b/ext/phar/tests/badparameters.phpt @@ -253,16 +253,16 @@ Phar::compress(): Argument #1 ($compression_type) must be of type int, array giv Cannot compress phar archive, phar is read-only Phar::compressFiles(): Argument #1 ($compression_type) must be of type int, array given Phar is readonly, cannot change compression -Phar::copy() expects exactly 2 parameters, 1 given +Phar::copy(): Exactly 2 arguments are expected, 1 given Cannot copy "a" to "b", phar is read-only Phar::offsetExists(): Argument #1 ($entry) must be of type string, array given Phar::offsetGet(): Argument #1 ($entry) must be of type string, array given -Phar::offsetSet() expects exactly 2 parameters, 1 given +Phar::offsetSet(): Exactly 2 arguments are expected, 1 given PharData::offsetUnset(): Argument #1 ($entry) must be of type string, array given Write operations disabled by the php.ini setting phar.readonly Phar::addEmptyDir(): Argument #1 ($dirname) must be of type string, array given Phar::addFile(): Argument #1 ($filename) must be of type string, array given -Phar::addFromString() expects exactly 2 parameters, 1 given +Phar::addFromString(): Exactly 2 arguments are expected, 1 given Write operations disabled by the php.ini setting phar.readonly -Phar::setMetadata() expects exactly 1 parameter, 2 given +Phar::setMetadata(): Exactly 1 argument is expected, 2 given Write operations disabled by the php.ini setting phar.readonly diff --git a/ext/phar/tests/bug60261.phpt b/ext/phar/tests/bug60261.phpt index 7f32bf64822c8..b9cf93d4904e7 100644 --- a/ext/phar/tests/bug60261.phpt +++ b/ext/phar/tests/bug60261.phpt @@ -14,4 +14,4 @@ try { ?> --EXPECT-- -Phar::__construct() expects at least 1 parameter, 0 given +Phar::__construct(): At least 1 argument is expected, 0 given diff --git a/ext/reflection/tests/ReflectionClass_constructor_002.phpt b/ext/reflection/tests/ReflectionClass_constructor_002.phpt index 44ff37a96202e..9bd4fa124be6a 100644 --- a/ext/reflection/tests/ReflectionClass_constructor_002.phpt +++ b/ext/reflection/tests/ReflectionClass_constructor_002.phpt @@ -46,10 +46,10 @@ try { ?> --EXPECT-- -ReflectionClass::__construct() expects exactly 1 parameter, 0 given +ReflectionClass::__construct(): Exactly 1 argument is expected, 0 given Class "" does not exist Class "1" does not exist Class "1" does not exist ReflectionClass::__construct(): Argument #1 ($objectOrClass) must be of type object|string, array given -ReflectionClass::__construct() expects exactly 1 parameter, 2 given +ReflectionClass::__construct(): Exactly 1 argument is expected, 2 given Class "X" does not exist diff --git a/ext/reflection/tests/ReflectionClass_getMethod_002.phpt b/ext/reflection/tests/ReflectionClass_getMethod_002.phpt index 99d5bb7e86a61..eeb68c63c52ff 100644 --- a/ext/reflection/tests/ReflectionClass_getMethod_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getMethod_002.phpt @@ -56,8 +56,8 @@ try { ?> --EXPECT-- Check invalid params: -ReflectionClass::getMethod() expects exactly 1 parameter, 0 given -ReflectionClass::getMethod() expects exactly 1 parameter, 2 given +ReflectionClass::getMethod(): Exactly 1 argument is expected, 0 given +ReflectionClass::getMethod(): Exactly 1 argument is expected, 2 given Method C::() does not exist Method C::1() does not exist Method C::1.5() does not exist diff --git a/ext/reflection/tests/ReflectionClass_getProperty_002.phpt b/ext/reflection/tests/ReflectionClass_getProperty_002.phpt index 606a124d5cc5c..19c9f0cb2dc8c 100644 --- a/ext/reflection/tests/ReflectionClass_getProperty_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getProperty_002.phpt @@ -54,8 +54,8 @@ try { ?> --EXPECT-- Check invalid params: -ReflectionClass::getProperty() expects exactly 1 parameter, 0 given -ReflectionClass::getProperty() expects exactly 1 parameter, 2 given +ReflectionClass::getProperty(): Exactly 1 argument is expected, 0 given +ReflectionClass::getProperty(): Exactly 1 argument is expected, 2 given Property C::$ does not exist Property C::$1 does not exist Property C::$1.5 does not exist diff --git a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt index 3e21780231f0e..6a2cd29d63bd5 100644 --- a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt @@ -39,8 +39,8 @@ try { ?> --EXPECT-- -ReflectionClass::getStaticPropertyValue() expects at most 2 parameters, 3 given -ReflectionClass::getStaticPropertyValue() expects at least 1 parameter, 0 given +ReflectionClass::getStaticPropertyValue(): At most 2 arguments are expected, 3 given +ReflectionClass::getStaticPropertyValue(): At least 1 argument is expected, 0 given Property C::$ does not exist string(3) "def" ReflectionClass::getStaticPropertyValue(): Argument #1 ($name) must be of type string, array given diff --git a/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt b/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt index 0ea64ca2788f1..6ca0fed6d8de9 100644 --- a/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt +++ b/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt @@ -144,8 +144,8 @@ Does I2 implement I2? Test bad arguments: -ReflectionClass::implementsInterface() expects exactly 1 parameter, 0 given -ReflectionClass::implementsInterface() expects exactly 1 parameter, 2 given +ReflectionClass::implementsInterface(): Exactly 1 argument is expected, 0 given +ReflectionClass::implementsInterface(): Exactly 1 argument is expected, 2 given Interface "" does not exist Interface "ThisClassDoesNotExist" does not exist Interface "2" does not exist diff --git a/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt b/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt index d69c16d6ac681..d56dc80c564cb 100644 --- a/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt +++ b/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt @@ -37,8 +37,8 @@ try { ?> --EXPECT-- Test bad arguments: -ReflectionClass::isSubclassOf() expects exactly 1 parameter, 0 given -ReflectionClass::isSubclassOf() expects exactly 1 parameter, 2 given +ReflectionClass::isSubclassOf(): Exactly 1 argument is expected, 0 given +ReflectionClass::isSubclassOf(): Exactly 1 argument is expected, 2 given Class "" does not exist Class "ThisClassDoesNotExist" does not exist Class "2" does not exist diff --git a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt index b9bb76c786e01..29ce40cb2c801 100644 --- a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt +++ b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt @@ -44,9 +44,9 @@ try { ?> --EXPECT-- -ReflectionClass::setStaticPropertyValue() expects exactly 2 parameters, 3 given -ReflectionClass::setStaticPropertyValue() expects exactly 2 parameters, 0 given -ReflectionClass::setStaticPropertyValue() expects exactly 2 parameters, 1 given +ReflectionClass::setStaticPropertyValue(): Exactly 2 arguments are expected, 3 given +ReflectionClass::setStaticPropertyValue(): Exactly 2 arguments are expected, 0 given +ReflectionClass::setStaticPropertyValue(): Exactly 2 arguments are expected, 1 given Class C does not have a property named Class C does not have a property named 1.5 ReflectionClass::setStaticPropertyValue(): Argument #1 ($name) must be of type string, array given diff --git a/ext/reflection/tests/ReflectionExtension_constructor_error.phpt b/ext/reflection/tests/ReflectionExtension_constructor_error.phpt index ccf2414e43e8e..3413adc4b32cc 100644 --- a/ext/reflection/tests/ReflectionExtension_constructor_error.phpt +++ b/ext/reflection/tests/ReflectionExtension_constructor_error.phpt @@ -25,7 +25,7 @@ try { ?> ---EXPECTF-- -Ok - ReflectionExtension::__construct() expects exactly %d parameter, %d given -Ok - ReflectionExtension::__construct() expects exactly %d parameter, %d given +--EXPECT-- +Ok - ReflectionExtension::__construct(): Exactly 1 argument is expected, 0 given +Ok - ReflectionExtension::__construct(): Exactly 1 argument is expected, 2 given Ok - ReflectionExtension::__construct(): Argument #1 ($name) must be of type string, array given diff --git a/ext/reflection/tests/ReflectionFunction_construct.001.phpt b/ext/reflection/tests/ReflectionFunction_construct.001.phpt index 307da25e5441d..bdc8e15622ea1 100644 --- a/ext/reflection/tests/ReflectionFunction_construct.001.phpt +++ b/ext/reflection/tests/ReflectionFunction_construct.001.phpt @@ -37,6 +37,6 @@ try { --EXPECT-- Ok - ReflectionFunction::__construct(): Argument #1 ($function) must be of type Closure|string, array given Function nonExistentFunction() does not exist -Ok - ReflectionFunction::__construct() expects exactly 1 parameter, 0 given -Ok - ReflectionFunction::__construct() expects exactly 1 parameter, 2 given +Ok - ReflectionFunction::__construct(): Exactly 1 argument is expected, 0 given +Ok - ReflectionFunction::__construct(): Exactly 1 argument is expected, 2 given Ok - ReflectionFunction::__construct(): Argument #1 ($function) must be of type Closure|string, array given diff --git a/ext/reflection/tests/ReflectionMethod_006.phpt b/ext/reflection/tests/ReflectionMethod_006.phpt index bb29b1cbed1ba..923d9a2befc0a 100644 --- a/ext/reflection/tests/ReflectionMethod_006.phpt +++ b/ext/reflection/tests/ReflectionMethod_006.phpt @@ -19,5 +19,5 @@ try { ?> --EXPECT-- -Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 0 given -Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 3 given +Ok - ReflectionMethod::__construct(): Exactly 1 argument is expected, 0 given +Ok - ReflectionMethod::__construct(): Exactly 1 argument is expected, 3 given diff --git a/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt b/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt index 0b02fb651c132..a26e83526680b 100644 --- a/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt +++ b/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt @@ -52,10 +52,10 @@ try{ ?> --EXPECT-- Too few arguments: -Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 0 given +Ok - ReflectionMethod::__construct(): Exactly 1 argument is expected, 0 given Too many arguments: -Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 3 given +Ok - ReflectionMethod::__construct(): Exactly 1 argument is expected, 3 given Ok - Class "InvalidClassName" does not exist Ok - ReflectionMethod::__construct(): Argument #1 ($objectOrMethod) must be of type object|string, array given -Ok - ReflectionMethod::__construct() expects exactly 1 parameter, 2 given +Ok - ReflectionMethod::__construct(): Exactly 1 argument is expected, 2 given diff --git a/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt b/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt index 73c04a687bfec..1d3533679e681 100644 --- a/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt +++ b/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt @@ -102,7 +102,7 @@ Called methodWithArgs(1, arg2) NULL Static method: -ReflectionMethod::invoke() expects at least 1 parameter, 0 given +ReflectionMethod::invoke(): At least 1 argument is expected, 0 given ReflectionMethod::invoke(): Argument #1 ($object) must be of type ?object, bool given Called staticMethod() Exception: Using $this when not in object context diff --git a/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt b/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt index 41042b7530449..e06bee59b5755 100644 --- a/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt +++ b/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt @@ -37,8 +37,8 @@ try { ?> --EXPECT-- Test bad arguments: -ReflectionClass::isSubclassOf() expects exactly 1 parameter, 0 given -ReflectionClass::isSubclassOf() expects exactly 1 parameter, 2 given +ReflectionClass::isSubclassOf(): Exactly 1 argument is expected, 0 given +ReflectionClass::isSubclassOf(): Exactly 1 argument is expected, 2 given Class "" does not exist Class "ThisClassDoesNotExist" does not exist Class "2" does not exist diff --git a/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt b/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt index 5fa249a9b58a1..a748062b99b52 100644 --- a/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt +++ b/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt @@ -43,6 +43,6 @@ echo "Done.\n"; Class "A" does not exist Method C::b() does not exist Method C::b() does not exist -Ok - ReflectionParameter::__construct() expects exactly 2 parameters, 1 given +Ok - ReflectionParameter::__construct(): Exactly 2 arguments are expected, 1 given Ok - ReflectionParameter::__construct(): Argument #1 ($function) must be either a string, an array(class, method) or a callable object, int given Done. diff --git a/ext/reflection/tests/ReflectionProperty_error.phpt b/ext/reflection/tests/ReflectionProperty_error.phpt index 052bfcb97c835..00ef4d65a2b5e 100644 --- a/ext/reflection/tests/ReflectionProperty_error.phpt +++ b/ext/reflection/tests/ReflectionProperty_error.phpt @@ -26,6 +26,6 @@ try { ?> --EXPECT-- -Ok - ReflectionProperty::__construct() expects exactly 2 parameters, 0 given -Ok - ReflectionProperty::__construct() expects exactly 2 parameters, 1 given -Ok - ReflectionProperty::__construct() expects exactly 2 parameters, 3 given +Ok - ReflectionProperty::__construct(): Exactly 2 arguments are expected, 0 given +Ok - ReflectionProperty::__construct(): Exactly 2 arguments are expected, 1 given +Ok - ReflectionProperty::__construct(): Exactly 2 arguments are expected, 3 given diff --git a/ext/reflection/tests/ReflectionProperty_getValue_error.phpt b/ext/reflection/tests/ReflectionProperty_getValue_error.phpt index 49b3c7bd9a90c..86c8346c208b7 100644 --- a/ext/reflection/tests/ReflectionProperty_getValue_error.phpt +++ b/ext/reflection/tests/ReflectionProperty_getValue_error.phpt @@ -57,7 +57,7 @@ try { Instance without property: Static property / too many args: -ReflectionProperty::getValue() expects at most 1 parameter, 2 given +ReflectionProperty::getValue(): At most 1 argument is expected, 2 given Protected property: Cannot access non-public property TestClass::$prot diff --git a/ext/session/tests/session_set_save_handler_class_012.phpt b/ext/session/tests/session_set_save_handler_class_012.phpt index 8f019d935b50d..f5d8d0ff00f15 100644 --- a/ext/session/tests/session_set_save_handler_class_012.phpt +++ b/ext/session/tests/session_set_save_handler_class_012.phpt @@ -45,7 +45,7 @@ var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i Open Warning: session_start(): Failed to initialize storage module: user (path: ) in %s on line %d -SessionHandler::open() expects exactly 2 parameters, 0 given +SessionHandler::open(): Exactly 2 arguments are expected, 0 given Warning: Undefined variable $_SESSION in %s on line %d string(0) "" diff --git a/ext/soap/tests/bugs/bug31422.phpt b/ext/soap/tests/bugs/bug31422.phpt index 4cf3a6332cec9..3bc0e1cee21f2 100644 --- a/ext/soap/tests/bugs/bug31422.phpt +++ b/ext/soap/tests/bugs/bug31422.phpt @@ -40,5 +40,5 @@ echo "ok\n"; ?> --EXPECT-- -SOAP-ENV:Serverfopen() expects at least 2 parameters, 0 given +SOAP-ENV:Serverfopen(): At least 2 arguments are expected, 0 given ok diff --git a/ext/sockets/tests/socket_connect_params.phpt b/ext/sockets/tests/socket_connect_params.phpt index 608e5d1c2e517..824c7e2168ab9 100644 --- a/ext/sockets/tests/socket_connect_params.phpt +++ b/ext/sockets/tests/socket_connect_params.phpt @@ -31,7 +31,7 @@ $s_w = socket_connect($s_c, '0.0.0.0', $port); socket_close($s_c); ?> --EXPECTF-- -socket_connect() expects at least 2 parameters, 1 given +socket_connect(): At least 2 arguments are expected, 1 given socket_connect(): Argument #3 ($port) cannot be null when the socket type is AF_INET Warning: socket_connect(): unable to connect [%i]: %a in %s on line %d diff --git a/ext/sodium/tests/bug78114.phpt b/ext/sodium/tests/bug78114.phpt index c697ea16f83ca..d0145fa5a5a8c 100644 --- a/ext/sodium/tests/bug78114.phpt +++ b/ext/sodium/tests/bug78114.phpt @@ -13,4 +13,4 @@ try { } ?> --EXPECT-- -sodium_bin2hex() expects exactly 1 parameter, 0 given +sodium_bin2hex(): Exactly 1 argument is expected, 0 given diff --git a/ext/spl/tests/CallbackFilterIteratorTest-002.phpt b/ext/spl/tests/CallbackFilterIteratorTest-002.phpt index c0c5aab1e97d9..6b74aa5863fef 100644 --- a/ext/spl/tests/CallbackFilterIteratorTest-002.phpt +++ b/ext/spl/tests/CallbackFilterIteratorTest-002.phpt @@ -42,8 +42,8 @@ try { } ?> --EXPECT-- -CallbackFilterIterator::__construct() expects exactly 2 parameters, 0 given -CallbackFilterIterator::__construct() expects exactly 2 parameters, 1 given +CallbackFilterIterator::__construct(): Exactly 2 arguments are expected, 0 given +CallbackFilterIterator::__construct(): Exactly 2 arguments are expected, 1 given CallbackFilterIterator::__construct(): Argument #2 ($callback) must be a valid callback, no array or string given CallbackFilterIterator::__construct(): Argument #2 ($callback) must be a valid callback, array must have exactly two members some message diff --git a/ext/spl/tests/arrayObject___construct_error2.phpt b/ext/spl/tests/arrayObject___construct_error2.phpt index 742512e02c816..645f9e73ed0dc 100644 --- a/ext/spl/tests/arrayObject___construct_error2.phpt +++ b/ext/spl/tests/arrayObject___construct_error2.phpt @@ -19,4 +19,4 @@ try { ?> --EXPECT-- Too many arguments: -ArrayObject::__construct() expects at most 3 parameters, 4 given(12) +ArrayObject::__construct(): At most 3 arguments are expected, 4 given(12) diff --git a/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt b/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt index 8eea9c96fd759..6a51b9508e890 100644 --- a/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt +++ b/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt @@ -81,7 +81,7 @@ array(2) { --> exchangeArray() with no arg: -Exception: ArrayObject::exchangeArray() expects exactly 1 parameter, 0 given +Exception: ArrayObject::exchangeArray(): Exactly 1 argument is expected, 0 given Warning: Undefined variable $copy in %s on line %d object(ArrayObject)#2 (1) { diff --git a/ext/spl/tests/arrayObject_uasort_error1.phpt b/ext/spl/tests/arrayObject_uasort_error1.phpt index 30a9734110cd0..67a9f57633a1a 100644 --- a/ext/spl/tests/arrayObject_uasort_error1.phpt +++ b/ext/spl/tests/arrayObject_uasort_error1.phpt @@ -22,5 +22,5 @@ try { } ?> --EXPECT-- -ArrayObject::uasort() expects exactly 1 parameter, 0 given -ArrayObject::uasort() expects exactly 1 parameter, 2 given +ArrayObject::uasort(): Exactly 1 argument is expected, 0 given +ArrayObject::uasort(): Exactly 1 argument is expected, 2 given diff --git a/ext/spl/tests/arrayObject_uksort_error1.phpt b/ext/spl/tests/arrayObject_uksort_error1.phpt index d1f5d5a6509ed..72d2c415718b4 100644 --- a/ext/spl/tests/arrayObject_uksort_error1.phpt +++ b/ext/spl/tests/arrayObject_uksort_error1.phpt @@ -22,5 +22,5 @@ try { } ?> --EXPECT-- -ArrayObject::uksort() expects exactly 1 parameter, 0 given -ArrayObject::uksort() expects exactly 1 parameter, 2 given +ArrayObject::uksort(): Exactly 1 argument is expected, 0 given +ArrayObject::uksort(): Exactly 1 argument is expected, 2 given diff --git a/ext/spl/tests/iterator_056.phpt b/ext/spl/tests/iterator_056.phpt index 28dd444856b9f..1a99f9d01f0b2 100644 --- a/ext/spl/tests/iterator_056.phpt +++ b/ext/spl/tests/iterator_056.phpt @@ -56,9 +56,9 @@ try { ?> --EXPECT-- -FilterIterator::__construct() expects exactly 1 parameter, 0 given -CachingIterator::__construct() expects at least 1 parameter, 0 given -RecursiveCachingIterator::__construct() expects at least 1 parameter, 0 given -ParentIterator::__construct() expects exactly 1 parameter, 0 given -LimitIterator::__construct() expects at least 1 parameter, 0 given -NoRewindIterator::__construct() expects exactly 1 parameter, 0 given +FilterIterator::__construct(): Exactly 1 argument is expected, 0 given +CachingIterator::__construct(): At least 1 argument is expected, 0 given +RecursiveCachingIterator::__construct(): At least 1 argument is expected, 0 given +ParentIterator::__construct(): Exactly 1 argument is expected, 0 given +LimitIterator::__construct(): At least 1 argument is expected, 0 given +NoRewindIterator::__construct(): Exactly 1 argument is expected, 0 given diff --git a/ext/spl/tests/iterator_062.phpt b/ext/spl/tests/iterator_062.phpt index a1440439c1abe..18a42e08cb42e 100644 --- a/ext/spl/tests/iterator_062.phpt +++ b/ext/spl/tests/iterator_062.phpt @@ -15,4 +15,4 @@ try { } ?> --EXPECT-- -RecursiveIteratorIterator::__construct() expects at least 1 parameter, 0 given +RecursiveIteratorIterator::__construct(): At least 1 argument is expected, 0 given diff --git a/ext/spl/tests/recursive_tree_iterator_002.phpt b/ext/spl/tests/recursive_tree_iterator_002.phpt index 048dccaac3d9f..2d54397b8ce87 100644 --- a/ext/spl/tests/recursive_tree_iterator_002.phpt +++ b/ext/spl/tests/recursive_tree_iterator_002.phpt @@ -11,4 +11,4 @@ try { } ?> --EXPECT-- -RecursiveTreeIterator::__construct() expects at least 1 parameter, 0 given +RecursiveTreeIterator::__construct(): At least 1 argument is expected, 0 given diff --git a/ext/spl/tests/spl_004.phpt b/ext/spl/tests/spl_004.phpt index c31d0b6157dc4..ea3791dc90bdd 100644 --- a/ext/spl/tests/spl_004.phpt +++ b/ext/spl/tests/spl_004.phpt @@ -86,4 +86,4 @@ int(4) ===ERRORS=== iterator_apply(): Argument #3 ($args) must be of type ?array, int given iterator_apply(): Argument #2 ($function) must be a valid callback, function "non_existing_function" not found or invalid function name -iterator_apply() expects at most 3 parameters, 4 given +iterator_apply(): At most 3 arguments are expected, 4 given diff --git a/ext/spl/tests/spl_iterator_iterator_constructor.phpt b/ext/spl/tests/spl_iterator_iterator_constructor.phpt index 95457484c8e14..c02eaad86f278 100644 --- a/ext/spl/tests/spl_iterator_iterator_constructor.phpt +++ b/ext/spl/tests/spl_iterator_iterator_constructor.phpt @@ -21,4 +21,4 @@ try { ?> --EXPECT-- -IteratorIterator::__construct() expects at most 2 parameters, 3 given +IteratorIterator::__construct(): At most 2 arguments are expected, 3 given diff --git a/ext/sqlite3/tests/sqlite3_02_open.phpt b/ext/sqlite3/tests/sqlite3_02_open.phpt index dcc38d1407cd3..26079df863e5f 100644 --- a/ext/sqlite3/tests/sqlite3_02_open.phpt +++ b/ext/sqlite3/tests/sqlite3_02_open.phpt @@ -16,4 +16,4 @@ try { ?> --EXPECT-- -string(60) "SQLite3::__construct() expects at least 1 parameter, 0 given" +string(64) "SQLite3::__construct(): At least 1 argument is expected, 0 given" diff --git a/ext/standard/tests/array/array_filter_variation10.phpt b/ext/standard/tests/array/array_filter_variation10.phpt index 5000783a8bd10..b896e639bf4ec 100644 --- a/ext/standard/tests/array/array_filter_variation10.phpt +++ b/ext/standard/tests/array/array_filter_variation10.phpt @@ -87,5 +87,5 @@ array(2) { ["b"]=> int(2) } -is_numeric() expects exactly 1 parameter, 2 given +is_numeric(): Exactly 1 argument is expected, 2 given Done diff --git a/ext/standard/tests/array/array_map_error.phpt b/ext/standard/tests/array/array_map_error.phpt index 5e770083e7052..e800bcbe4541f 100644 --- a/ext/standard/tests/array/array_map_error.phpt +++ b/ext/standard/tests/array/array_map_error.phpt @@ -37,7 +37,7 @@ echo "Done"; *** Testing array_map() : error conditions *** -- Testing array_map() function with one less than expected no. of arguments -- -Exception: array_map() expects at least 2 parameters, 1 given +Exception: array_map(): At least 2 arguments are expected, 1 given -- Testing array_map() function with less no. of arrays than callback function arguments -- Exception: Too few arguments to function callback2(), 1 passed and exactly 2 expected diff --git a/ext/standard/tests/array/array_map_variation12.phpt b/ext/standard/tests/array/array_map_variation12.phpt index 1c4f3b23a1af8..518d30a463f52 100644 --- a/ext/standard/tests/array/array_map_variation12.phpt +++ b/ext/standard/tests/array/array_map_variation12.phpt @@ -42,7 +42,7 @@ array(3) { int(243) } -- with built-in function 'pow' and one parameter -- -pow() expects exactly 2 parameters, 1 given +pow(): Exactly 2 arguments are expected, 1 given -- with language construct -- array_map(): Argument #1 ($callback) must be a valid callback, function "echo" not found or invalid function name Done diff --git a/ext/standard/tests/array/array_walk_error2.phpt b/ext/standard/tests/array/array_walk_error2.phpt index d3209d87c2327..0399c272f43a8 100644 --- a/ext/standard/tests/array/array_walk_error2.phpt +++ b/ext/standard/tests/array/array_walk_error2.phpt @@ -56,5 +56,5 @@ Exception: Too few arguments to function callback2(), 3 passed and exactly 4 exp Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected -- Testing array_walk() function with too many callback parameters -- -Exception: array_walk() expects at most 3 parameters, 4 given +Exception: array_walk(): At most 3 arguments are expected, 4 given Done diff --git a/ext/standard/tests/array/array_walk_recursive_error2.phpt b/ext/standard/tests/array/array_walk_recursive_error2.phpt index ad4fd99ede623..28e6fc1a9aa30 100644 --- a/ext/standard/tests/array/array_walk_recursive_error2.phpt +++ b/ext/standard/tests/array/array_walk_recursive_error2.phpt @@ -56,5 +56,5 @@ Exception: Too few arguments to function callback2(), 3 passed and exactly 4 exp Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected -- Testing array_walk_recursive() function with too many callback parameters -- -Exception: array_walk_recursive() expects at most 3 parameters, 4 given +Exception: array_walk_recursive(): At most 3 arguments are expected, 4 given Done diff --git a/ext/standard/tests/password/password_hash_error.phpt b/ext/standard/tests/password/password_hash_error.phpt index ddb5793c815c8..b7a4784eababd 100644 --- a/ext/standard/tests/password/password_hash_error.phpt +++ b/ext/standard/tests/password/password_hash_error.phpt @@ -36,7 +36,7 @@ try { ?> --EXPECT-- -password_hash() expects at least 2 parameters, 1 given +password_hash(): At least 2 arguments are expected, 1 given password_hash(): Argument #2 ($algo) must be of type string|int|null, array given password_hash(): Argument #3 ($options) must be of type array, stdClass given password_hash(): Argument #3 ($options) must be of type array, string given diff --git a/ext/standard/tests/password/password_needs_rehash_error.phpt b/ext/standard/tests/password/password_needs_rehash_error.phpt index aef86ee1247c8..227ab516e6130 100644 --- a/ext/standard/tests/password/password_needs_rehash_error.phpt +++ b/ext/standard/tests/password/password_needs_rehash_error.phpt @@ -30,7 +30,7 @@ try { echo "OK!"; ?> --EXPECT-- -password_needs_rehash() expects at least 2 parameters, 1 given +password_needs_rehash(): At least 2 arguments are expected, 1 given password_needs_rehash(): Argument #2 ($algo) must be of type string|int|null, array given password_needs_rehash(): Argument #1 ($hash) must be of type string, array given password_needs_rehash(): Argument #3 ($options) must be of type array, string given diff --git a/ext/standard/tests/password/password_verify_error.phpt b/ext/standard/tests/password/password_verify_error.phpt index 192a4ae288d49..2cb6925cbb205 100644 --- a/ext/standard/tests/password/password_verify_error.phpt +++ b/ext/standard/tests/password/password_verify_error.phpt @@ -12,4 +12,4 @@ try { ?> --EXPECT-- -password_verify() expects exactly 2 parameters, 1 given +password_verify(): Exactly 2 arguments are expected, 1 given diff --git a/ext/standard/tests/random/random_bytes_error.phpt b/ext/standard/tests/random/random_bytes_error.phpt index 5a8b1d097c16f..51cca7c9b6751 100644 --- a/ext/standard/tests/random/random_bytes_error.phpt +++ b/ext/standard/tests/random/random_bytes_error.phpt @@ -18,5 +18,5 @@ try { ?> --EXPECT-- -random_bytes() expects exactly 1 parameter, 0 given +random_bytes(): Exactly 1 argument is expected, 0 given random_bytes(): Argument #1 ($length) must be greater than 0 diff --git a/ext/standard/tests/random/random_int_error.phpt b/ext/standard/tests/random/random_int_error.phpt index 6d91b38258117..c6f4864987e13 100644 --- a/ext/standard/tests/random/random_int_error.phpt +++ b/ext/standard/tests/random/random_int_error.phpt @@ -24,6 +24,6 @@ try { ?> --EXPECT-- -random_int() expects exactly 2 parameters, 0 given -random_int() expects exactly 2 parameters, 1 given +random_int(): Exactly 2 arguments are expected, 0 given +random_int(): Exactly 2 arguments are expected, 1 given random_int(): Argument #1 ($min) must be less than or equal to argument #2 ($max) diff --git a/ext/standard/tests/strings/chr_error.phpt b/ext/standard/tests/strings/chr_error.phpt index 59dfffd53b1d0..efc8279f7051c 100644 --- a/ext/standard/tests/strings/chr_error.phpt +++ b/ext/standard/tests/strings/chr_error.phpt @@ -25,7 +25,7 @@ try { *** Testing chr() : error conditions *** -- Testing chr() function with no arguments -- -chr() expects exactly 1 parameter, 0 given +chr(): Exactly 1 argument is expected, 0 given -- Testing chr() function with more than expected no. of arguments -- -chr() expects exactly 1 parameter, 2 given +chr(): Exactly 1 argument is expected, 2 given diff --git a/ext/standard/tests/strings/fprintf_error.phpt b/ext/standard/tests/strings/fprintf_error.phpt index 3671300e601e0..efce78443f271 100644 --- a/ext/standard/tests/strings/fprintf_error.phpt +++ b/ext/standard/tests/strings/fprintf_error.phpt @@ -31,7 +31,7 @@ echo "Done\n"; ?> --EXPECT-- *** Testing Error Conditions *** -fprintf() expects at least 2 parameters, 0 given -fprintf() expects at least 2 parameters, 1 given -fprintf() expects at least 2 parameters, 1 given +fprintf(): At least 2 arguments are expected, 0 given +fprintf(): At least 2 arguments are expected, 1 given +fprintf(): At least 2 arguments are expected, 1 given Done diff --git a/ext/standard/tests/strings/printf.phpt b/ext/standard/tests/strings/printf.phpt index d77dd71c36f43..72c08ffe0b6de 100644 --- a/ext/standard/tests/strings/printf.phpt +++ b/ext/standard/tests/strings/printf.phpt @@ -238,7 +238,7 @@ printf("%d", $tempstring); ?> --EXPECTF-- *** Output for zero argument *** -printf() expects at least %d parameter, %d given +printf(): At least %d argument is expected, %d given *** Output for insufficient number of arguments *** Error found: 5 parameters are required, 3 given diff --git a/ext/standard/tests/strings/printf_64bit.phpt b/ext/standard/tests/strings/printf_64bit.phpt index b0e364b9c98f2..782ed464e2854 100644 --- a/ext/standard/tests/strings/printf_64bit.phpt +++ b/ext/standard/tests/strings/printf_64bit.phpt @@ -238,7 +238,7 @@ printf("%d", $tempstring); ?> --EXPECTF-- *** Output for zero argument *** -printf() expects at least 1 parameter, 0 given +printf(): At least 1 argument is expected, 0 given *** Output for insufficient number of arguments *** Error found: 5 parameters are required, 3 given diff --git a/ext/standard/tests/strings/printf_error.phpt b/ext/standard/tests/strings/printf_error.phpt index 819bb7d1e0f8d..700bbe8ac8b0d 100644 --- a/ext/standard/tests/strings/printf_error.phpt +++ b/ext/standard/tests/strings/printf_error.phpt @@ -60,7 +60,7 @@ try { *** Testing printf() : error conditions *** -- Testing printf() function with Zero arguments -- -printf() expects at least 1 parameter, 0 given +printf(): At least 1 argument is expected, 0 given -- Testing printf() function with less than expected no. of arguments -- diff --git a/ext/standard/tests/strings/sprintf_error.phpt b/ext/standard/tests/strings/sprintf_error.phpt index 89ff16b72ba3b..60f91bfb6a388 100644 --- a/ext/standard/tests/strings/sprintf_error.phpt +++ b/ext/standard/tests/strings/sprintf_error.phpt @@ -69,11 +69,11 @@ try { echo "Done"; ?> ---EXPECTF-- +--EXPECT-- *** Testing sprintf() : error conditions *** -- Testing sprintf() function with Zero arguments -- -sprintf() expects at least %d parameter, %d given +sprintf(): At least 1 argument is expected, 0 given -- Testing sprintf() function with less than expected no. of arguments -- 2 parameters are required, 1 given diff --git a/ext/standard/tests/strings/vfprintf_error1.phpt b/ext/standard/tests/strings/vfprintf_error1.phpt index d93de7dc560b6..37fdd6b7ed774 100644 --- a/ext/standard/tests/strings/vfprintf_error1.phpt +++ b/ext/standard/tests/strings/vfprintf_error1.phpt @@ -38,5 +38,5 @@ unlink( $file ); ?> --EXPECT-- -- Testing vfprintf() function with more than expected no. of arguments -- -vfprintf() expects exactly 3 parameters, 4 given -vfprintf() expects exactly 3 parameters, 4 given +vfprintf(): Exactly 3 arguments are expected, 4 given +vfprintf(): Exactly 3 arguments are expected, 4 given diff --git a/tests/output/ob_014.phpt b/tests/output/ob_014.phpt index bc46f2ae580c1..c4c9c8694500e 100644 --- a/tests/output/ob_014.phpt +++ b/tests/output/ob_014.phpt @@ -12,4 +12,4 @@ try { ?> --EXPECT-- foo -str_rot13() expects exactly 1 parameter, 2 given +str_rot13(): Exactly 1 argument is expected, 2 given diff --git a/tests/output/ob_015.phpt b/tests/output/ob_015.phpt index 2bc08687d77fd..fbd4e259a2677 100644 --- a/tests/output/ob_015.phpt +++ b/tests/output/ob_015.phpt @@ -12,4 +12,4 @@ ob_end_flush(); ?> --EXPECT-- foo -str_rot13() expects exactly 1 parameter, 2 given +str_rot13(): Exactly 1 argument is expected, 2 given From ed15187bfc01cc06b1647eccfaa80be504f4868a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Mon, 31 Aug 2020 00:26:49 +0200 Subject: [PATCH 3/6] Improve error message for count() --- Zend/tests/generators/errors/count_error.phpt | 2 +- Zend/zend_vm_def.h | 2 +- Zend/zend_vm_execute.h | 7 +- ext/standard/array.c | 6 +- ext/standard/basic_functions.stub.php | 4 +- ext/standard/tests/array/count_invalid.phpt | 12 +- ext/standard/tests/array/count_recursive.phpt | 18 +-- ext/standard/tests/array/sizeof_basic1.phpt | 12 +- ext/standard/tests/array/sizeof_object2.phpt | 30 ++--- .../tests/array/sizeof_variation1.phpt | 114 ++++++++--------- .../tests/array/sizeof_variation4.phpt | 120 +++++++++--------- .../is_countable_with_variables.phpt | 2 +- 12 files changed, 164 insertions(+), 165 deletions(-) diff --git a/Zend/tests/generators/errors/count_error.phpt b/Zend/tests/generators/errors/count_error.phpt index 97e03e7d712d2..2eacfd0d359ea 100644 --- a/Zend/tests/generators/errors/count_error.phpt +++ b/Zend/tests/generators/errors/count_error.phpt @@ -15,4 +15,4 @@ try { ?> --EXPECTF-- -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, Generator given in %s on line %d diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index ee8347d644751..4d2c638469409 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -8925,7 +8925,7 @@ ZEND_VM_COLD_CONST_HANDLER(190, ZEND_COUNT, CONST|TMPVAR|CV, UNUSED) } else { count = 1; } - zend_error(E_WARNING, "%s(): Parameter must be an array or an object that implements Countable", opline->extended_value ? "sizeof" : "count"); + zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1)); break; } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index b39a408531398..f0fe1ef69da59 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -2281,7 +2281,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_CREATE_SPEC_HANDLER( static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_cannot_pass_by_ref_helper_SPEC(uint32_t _arg_num, zval *_arg ZEND_OPCODE_HANDLER_ARGS_DC) { USE_OPLINE - zval *arg; char *func_name = get_function_or_method_name(EX(call)->func); const char *param_name = get_function_arg_name(EX(call)->func, _arg_num); @@ -10572,7 +10571,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CONST_ } else { count = 1; } - zend_error(E_WARNING, "%s(): Parameter must be an array or an object that implements Countable", opline->extended_value ? "sizeof" : "count"); + zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1)); break; } @@ -17885,7 +17884,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_TMPVAR_UNUSED_HANDL } else { count = 1; } - zend_error(E_WARNING, "%s(): Parameter must be an array or an object that implements Countable", opline->extended_value ? "sizeof" : "count"); + zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1)); break; } @@ -48250,7 +48249,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_COUNT_SPEC_CV_UNUSED_HANDLER(Z } else { count = 1; } - zend_error(E_WARNING, "%s(): Parameter must be an array or an object that implements Countable", opline->extended_value ? "sizeof" : "count"); + zend_error(E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", opline->extended_value ? "sizeof" : "count", zend_zval_type_name(op1)); break; } diff --git a/ext/standard/array.c b/ext/standard/array.c index b8996f8a34288..55b4e629ebee8 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -745,7 +745,7 @@ PHP_FUNCTION(count) switch (Z_TYPE_P(array)) { case IS_NULL: /* Intentionally not converted to an exception */ - php_error_docref(NULL, E_WARNING, "Parameter must be an array or an object that implements Countable"); + php_error_docref(NULL, E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", get_active_function_name(), zend_zval_type_name(array)); RETURN_LONG(0); break; case IS_ARRAY: @@ -780,13 +780,13 @@ PHP_FUNCTION(count) /* If There's no handler and it doesn't implement Countable then add a warning */ /* Intentionally not converted to an exception */ - php_error_docref(NULL, E_WARNING, "Parameter must be an array or an object that implements Countable"); + php_error_docref(NULL, E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", get_active_function_name(), zend_zval_type_name(array)); RETURN_LONG(1); break; } default: /* Intentionally not converted to an exception */ - php_error_docref(NULL, E_WARNING, "Parameter must be an array or an object that implements Countable"); + php_error_docref(NULL, E_WARNING, "%s(): Argument #1 ($var) must be of type Countable|array, %s given", get_active_function_name(), zend_zval_type_name(array)); RETURN_LONG(1); break; } diff --git a/ext/standard/basic_functions.stub.php b/ext/standard/basic_functions.stub.php index 9352b9712c148..8ec2eef3a78f4 100755 --- a/ext/standard/basic_functions.stub.php +++ b/ext/standard/basic_functions.stub.php @@ -63,11 +63,11 @@ function krsort(array &$array, int $sort_flags = SORT_REGULAR): bool {} function ksort(array &$array, int $sort_flags = SORT_REGULAR): bool {} -/** @param array|Countable|null $var */ +/** @param Countable|array $var */ function count($var, int $mode = COUNT_NORMAL): int {} /** - * @param array|object|null $var + * @param Countable|array $var * @alias count */ function sizeof($var, int $mode = COUNT_NORMAL): int {} diff --git a/ext/standard/tests/array/count_invalid.phpt b/ext/standard/tests/array/count_invalid.phpt index 95da00dac5100..4b146de85b933 100644 --- a/ext/standard/tests/array/count_invalid.phpt +++ b/ext/standard/tests/array/count_invalid.phpt @@ -23,20 +23,20 @@ var_dump($result); ?> --EXPECTF-- -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, stdClass given in %s on line %d int(1) diff --git a/ext/standard/tests/array/count_recursive.phpt b/ext/standard/tests/array/count_recursive.phpt index bae0fc94239b0..8532a74cb68ed 100644 --- a/ext/standard/tests/array/count_recursive.phpt +++ b/ext/standard/tests/array/count_recursive.phpt @@ -113,10 +113,10 @@ closedir( $resource2 ); *** Testing basic functionality of count() function *** -- Testing NULL -- -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): count(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d COUNT_NORMAL: should be 0, is 0 -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): count(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d COUNT_RECURSIVE: should be 0, is 0 -- Testing arrays -- COUNT_NORMAL: should be 2, is 2 @@ -126,14 +126,14 @@ COUNT_NORMAL: should be 3, is 3 COUNT_RECURSIVE: should be 6, is 6 -- Testing strings -- -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): count(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d COUNT_NORMAL: should be 1, is 1 -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): count(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d COUNT_RECURSIVE: should be 1, is 1 -- Testing various types with no second argument -- -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d COUNT_NORMAL: should be 1, is 1 COUNT_NORMAL: should be 2, is 2 -- Testing really cool arrays -- @@ -175,18 +175,18 @@ COUNT_RECURSIVE is 7 -- Testing count() on constants with no second argument -- -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d COUNT_NORMAL: should be 1, is 1 -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d COUNT_NORMAL: should be 1, is 1 -- Testing count() on NULL and Unset variables -- -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d COUNT_NORMAL: should be 0, is 0 -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d COUNT_NORMAL: should be 1, is 1 COUNT_NORMAL: should be 0, is 0 diff --git a/ext/standard/tests/array/sizeof_basic1.phpt b/ext/standard/tests/array/sizeof_basic1.phpt index 68dcc52a23efc..4c5910e3570e6 100644 --- a/ext/standard/tests/array/sizeof_basic1.phpt +++ b/ext/standard/tests/array/sizeof_basic1.phpt @@ -39,27 +39,27 @@ echo "Done"; *** Testing sizeof() : basic functionality *** -- Testing sizeof() for integer type in default, COUNT_NORMAL and COUNT_RECURSIVE modes -- default mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) COUNT_NORMAL mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) COUNT_RECURSIVE mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) -- Testing sizeof() for float type in default, COUNT_NORMAL and COUNT_RECURSIVE modes -- default mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_NORMAL mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_RECURSIVE mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) Done diff --git a/ext/standard/tests/array/sizeof_object2.phpt b/ext/standard/tests/array/sizeof_object2.phpt index 513b239b129e1..9a96719eb68c0 100644 --- a/ext/standard/tests/array/sizeof_object2.phpt +++ b/ext/standard/tests/array/sizeof_object2.phpt @@ -95,67 +95,67 @@ echo "Done"; --- Testing sizeof() with objects which doesn't implement Countable interface --- -- Iteration 1 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, test given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, test given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, test given in %s on line %d int(1) -- Iteration 2 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, test1 given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, test1 given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, test1 given in %s on line %d int(1) -- Iteration 3 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, test2 given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, test2 given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, test2 given in %s on line %d int(1) -- Iteration 4 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, child_test2 given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, child_test2 given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, child_test2 given in %s on line %d int(1) -- Iteration 5 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, concrete_class given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, concrete_class given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, concrete_class given in %s on line %d int(1) Done diff --git a/ext/standard/tests/array/sizeof_variation1.phpt b/ext/standard/tests/array/sizeof_variation1.phpt index 5f3988b8bd269..13196d3170edb 100644 --- a/ext/standard/tests/array/sizeof_variation1.phpt +++ b/ext/standard/tests/array/sizeof_variation1.phpt @@ -74,249 +74,249 @@ echo "Done"; --- Testing sizeof() for all scalar types in default,COUNT_NORMAL and COUNT_RECURSIVE mode --- -- Iteration 1 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) -- Iteration 2 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, int given in %s on line %d int(1) -- Iteration 3 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) -- Iteration 4 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) -- Iteration 5 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) -- Iteration 6 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) -- Iteration 7 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, float given in %s on line %d int(1) -- Iteration 8 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 9 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 10 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) -- Iteration 11 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) -- Iteration 12 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) -- Iteration 13 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, bool given in %s on line %d int(1) -- Iteration 14 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) -- Iteration 15 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) -- Iteration 16 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) -- Iteration 17 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, string given in %s on line %d int(1) -- Iteration 18 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 19 -- Default Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, resource given in %s on line %d int(1) COUNT_NORMAL Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, resource given in %s on line %d int(1) COUNT_RECURSIVE Mode: -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, resource given in %s on line %d int(1) Done diff --git a/ext/standard/tests/array/sizeof_variation4.phpt b/ext/standard/tests/array/sizeof_variation4.phpt index e0c4b13eaa964..c8484d84512ca 100644 --- a/ext/standard/tests/array/sizeof_variation4.phpt +++ b/ext/standard/tests/array/sizeof_variation4.phpt @@ -84,380 +84,380 @@ echo "Done"; Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 2 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 3 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 4 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 5 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 6 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 7 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 8 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 9 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 10 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 11 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 12 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 13 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 14 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 15 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 16 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 17 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 18 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 19 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) -- Iteration 20 -- Default Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_NORMAL Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) COUNT_RECURSIVE Mode: Warning: Undefined variable $value in %s on line %d -Warning: sizeof(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: sizeof(): sizeof(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d int(0) Done diff --git a/ext/standard/tests/general_functions/is_countable_with_variables.phpt b/ext/standard/tests/general_functions/is_countable_with_variables.phpt index 0cb18769d64b8..7a4efc914b27d 100644 --- a/ext/standard/tests/general_functions/is_countable_with_variables.phpt +++ b/ext/standard/tests/general_functions/is_countable_with_variables.phpt @@ -25,4 +25,4 @@ bool(true) bool(false) int(2) -Warning: count(): Parameter must be an array or an object that implements Countable in %s on line %d +Warning: count(): Argument #1 ($var) must be of type Countable|array, null given in %s on line %d From e9d1fec25bb74b8fe2fef87d73515a5607258ba7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Mon, 7 Sep 2020 23:00:47 +0200 Subject: [PATCH 4/6] Code review changes --- Zend/tests/bug46106.phpt | 2 +- Zend/tests/bug51827.phpt | 2 +- Zend/tests/bug72107.phpt | 2 +- .../argument_count_incorrect_internal.phpt | 2 +- ...ument_count_incorrect_internal_strict.phpt | 2 +- Zend/tests/nullsafe_operator/013.phpt | 6 +- Zend/zend_API.c | 39 ++++++------- Zend/zend_execute.h | 4 +- Zend/zend_execute_API.c | 17 +++--- Zend/zend_vm_def.h | 6 +- Zend/zend_vm_execute.h | 6 +- .../tests/DateTimeZone_construct_error.phpt | 2 +- ext/date/tests/DateTime_construct_error.phpt | 2 +- ext/date/tests/mktime_error.phpt | 4 +- .../tests/DOMAttr_construct_error_001.phpt | 2 +- .../DOMCDATASection_construct_error_001.phpt | 2 +- .../tests/DOMComment_construct_error_001.phpt | 2 +- ...MDocumentFragment_construct_error_001.phpt | 2 +- ext/fileinfo/tests/bug61173.phpt | 2 +- ext/imap/tests/imap_timeout_basic.phpt | 2 +- .../tests/breakiter___construct_error.phpt | 4 +- .../tests/calendar_before_after_error.phpt | 12 ++-- ext/intl/tests/calendar_equals_error.phpt | 4 +- .../tests/calendar_fieldDifference_error.phpt | 4 +- ext/intl/tests/calendar_getLocale_error.phpt | 2 +- ...r_get_getActualMaximum_Minumum_error2.phpt | 12 ++-- .../tests/calendar_isEquivalentTo_error.phpt | 4 +- .../tests/calendar_setTimeZone_error.phpt | 6 +- ext/intl/tests/calendar_setTime_error.phpt | 2 +- ext/intl/tests/calendar_set_error.phpt | 2 +- ext/intl/tests/formatter_fail.phpt | 6 +- ext/intl/tests/msgfmt_fail2.phpt | 12 ++-- ext/json/tests/json_last_error_error.phpt | 2 +- ext/json/tests/json_last_error_msg_error.phpt | 2 +- ext/mysqli/tests/mysqli_connect_errno.phpt | 2 +- ext/mysqli/tests/mysqli_connect_error.phpt | 2 +- ext/mysqli/tests/mysqli_fetch_object_oo.phpt | 2 +- ext/mysqli/tests/mysqli_pconn_max_links.phpt | 4 +- ext/oci8/tests/array_bind_013.phpt | 2 +- ext/opcache/jit/zend_jit_helpers.c | 7 ++- .../tests/pdo_oci_stmt_getcolumnmeta.phpt | 4 +- ext/phar/tests/002.phpt | 2 +- ext/phar/tests/badparameters.phpt | 8 +-- ext/phar/tests/bug60261.phpt | 2 +- .../ReflectionClass_constructor_002.phpt | 4 +- .../tests/ReflectionClass_getMethod_002.phpt | 4 +- .../ReflectionClass_getProperty_002.phpt | 4 +- ...ctionClass_getStaticPropertyValue_002.phpt | 4 +- ...flectionClass_implementsInterface_001.phpt | 4 +- .../ReflectionClass_isSubclassOf_002.phpt | 4 +- ...ctionClass_setStaticPropertyValue_002.phpt | 8 +-- ...ReflectionExtension_constructor_error.phpt | 6 +- .../ReflectionFunction_construct.001.phpt | 4 +- .../tests/ReflectionMethod_006.phpt | 4 +- .../ReflectionMethod_constructor_error2.phpt | 6 +- .../tests/ReflectionMethod_invoke_basic.phpt | 2 +- .../ReflectionObject_isSubclassOf.002.phpt | 4 +- ...nParameter_invalidMethodInConstructor.phpt | 2 +- .../tests/ReflectionProperty_error.phpt | 6 +- .../ReflectionProperty_getValue_error.phpt | 2 +- .../session_set_save_handler_class_012.phpt | 4 +- .../session_set_save_handler_class_013.phpt | 4 +- ext/snmp/tests/snmp-object-error.phpt | 2 +- ext/soap/tests/bugs/bug31422.phpt | 2 +- ext/sockets/tests/socket_connect_params.phpt | 2 +- ext/sodium/tests/bug78114.phpt | 2 +- .../tests/AppendIterator_invalid_ctor.phpt | 2 +- .../tests/CallbackFilterIteratorTest-002.phpt | 4 +- .../tests/arrayObject___construct_error2.phpt | 2 +- .../arrayObject_exchangeArray_basic3.phpt | 2 +- .../tests/arrayObject_natcasesort_basic1.phpt | 2 +- ext/spl/tests/arrayObject_natsort_basic1.phpt | 2 +- ext/spl/tests/arrayObject_uasort_error1.phpt | 4 +- ext/spl/tests/arrayObject_uksort_error1.phpt | 4 +- ext/spl/tests/iterator_056.phpt | 12 ++-- ext/spl/tests/iterator_062.phpt | 2 +- .../tests/recursive_tree_iterator_002.phpt | 2 +- ext/spl/tests/spl_004.phpt | 2 +- .../spl_iterator_iterator_constructor.phpt | 2 +- ext/sqlite3/tests/sqlite3_02_open.phpt | 2 +- ext/standard/array.c | 10 ++-- ext/standard/basic_functions_arginfo.h | 2 +- .../tests/array/array_diff_uassoc_error.phpt | 2 +- .../tests/array/array_filter_variation10.phpt | 2 +- .../array/array_intersect_assoc_error.phpt | 4 +- .../tests/array/array_intersect_error.phpt | 4 +- .../array/array_intersect_key_error.phpt | 4 +- ext/standard/tests/array/array_map_error.phpt | 2 +- .../tests/array/array_map_variation12.phpt | 2 +- .../tests/array/array_walk_error2.phpt | 2 +- .../array/array_walk_recursive_error2.phpt | 2 +- .../general_functions/error_get_last.phpt | 2 +- .../tests/password/password_hash_error.phpt | 2 +- .../password/password_needs_rehash_error.phpt | 2 +- .../tests/password/password_verify_error.phpt | 2 +- .../tests/random/random_bytes_error.phpt | 2 +- .../tests/random/random_int_error.phpt | 4 +- ext/standard/tests/strings/chr_error.phpt | 4 +- ext/standard/tests/strings/crypt.phpt | 2 +- ext/standard/tests/strings/fprintf_error.phpt | 6 +- ext/standard/tests/strings/printf.phpt | 56 +++++++++---------- ext/standard/tests/strings/printf_64bit.phpt | 2 +- ext/standard/tests/strings/printf_error.phpt | 2 +- ext/standard/tests/strings/sprintf_error.phpt | 2 +- .../tests/strings/vfprintf_error1.phpt | 4 +- ...cessor_hasExsltSupport_wrongparam_001.phpt | 2 +- tests/output/ob_014.phpt | 2 +- tests/output/ob_015.phpt | 2 +- 108 files changed, 238 insertions(+), 241 deletions(-) diff --git a/Zend/tests/bug46106.phpt b/Zend/tests/bug46106.phpt index a8658cb295e5d..7f0ae66debfe3 100644 --- a/Zend/tests/bug46106.phpt +++ b/Zend/tests/bug46106.phpt @@ -23,5 +23,5 @@ try { ?> DONE --EXPECT-- -str_pad(): At least 2 arguments are expected, 1 given +str_pad() expects at least 2 arguments, 1 given DONE diff --git a/Zend/tests/bug51827.phpt b/Zend/tests/bug51827.phpt index 79b17c6773771..1b91345e34a32 100644 --- a/Zend/tests/bug51827.phpt +++ b/Zend/tests/bug51827.phpt @@ -16,7 +16,7 @@ register_shutdown_function('exploDe'); --EXPECT-- int(1) -Fatal error: Uncaught ArgumentCountError: explode(): At least 2 arguments are expected, 0 given in [no active file]:0 +Fatal error: Uncaught ArgumentCountError: explode() expects at least 2 arguments, 0 given in [no active file]:0 Stack trace: #0 [internal function]: explode() #1 {main} diff --git a/Zend/tests/bug72107.phpt b/Zend/tests/bug72107.phpt index b37ecf0849a48..f65b1422691fc 100644 --- a/Zend/tests/bug72107.phpt +++ b/Zend/tests/bug72107.phpt @@ -13,4 +13,4 @@ try { } ?> --EXPECT-- -func_get_args() expects exactly 0 parameters, 4 given +func_get_args() expects exactly 0 arguments, 4 given diff --git a/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt b/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt index 16f9a7e65b63d..d23a6a0c70574 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt @@ -9,4 +9,4 @@ try { } ?> --EXPECT-- -substr(): At least 2 arguments are expected, 1 given +substr() expects at least 2 arguments, 1 given diff --git a/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt b/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt index e77fc74c5d365..5bce4b19e634b 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt @@ -19,6 +19,6 @@ try { ?> --EXPECT-- ArgumentCountError -substr(): At least 2 arguments are expected, 1 given +substr() expects at least 2 arguments, 1 given ArgumentCountError At least 2 parameters are required, 1 given diff --git a/Zend/tests/nullsafe_operator/013.phpt b/Zend/tests/nullsafe_operator/013.phpt index 0fef34b2b7644..fd1fbc9006f68 100644 --- a/Zend/tests/nullsafe_operator/013.phpt +++ b/Zend/tests/nullsafe_operator/013.phpt @@ -50,10 +50,10 @@ int(0) string(98) "call_user_func_array(): Argument #1 ($function) must be a valid callback, no array or string given" string(77) "call_user_func_array(): Argument #2 ($args) must be of type array, null given" string(69) "get_class(): Argument #1 ($object) must be of type object, null given" -string(56) "get_called_class() expects exactly 0 parameters, 1 given" +string(55) "get_called_class() expects exactly 0 arguments, 1 given" string(4) "NULL" -string(53) "func_num_args() expects exactly 0 parameters, 1 given" -string(53) "func_get_args() expects exactly 0 parameters, 1 given" +string(52) "func_num_args() expects exactly 0 arguments, 1 given" +string(52) "func_get_args() expects exactly 0 arguments, 1 given" string(69) "array_slice(): Argument #1 ($array) must be of type array, null given" array(1) { [0]=> diff --git a/Zend/zend_API.c b/Zend/zend_API.c index fd0d3499208d0..beaae81323a7c 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -183,33 +183,29 @@ ZEND_API zend_string *zend_zval_get_legacy_type(const zval *arg) /* {{{ */ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_none_error(void) /* {{{ */ { int num_args = ZEND_CALL_NUM_ARGS(EG(current_execute_data)); - zend_function *active_function = EG(current_execute_data)->func; - const char *class_name = active_function->common.scope ? ZSTR_VAL(active_function->common.scope->name) : ""; + zend_string *func_name = get_active_function_or_method_name(); - zend_argument_count_error( - "%s%s%s() expects exactly 0 parameters, %d given", - class_name, \ - class_name[0] ? "::" : "", \ - ZSTR_VAL(active_function->common.function_name), - num_args); + zend_argument_count_error("%s() expects exactly 0 arguments, %d given", ZSTR_VAL(func_name), num_args); + + zend_string_release(func_name); } /* }}} */ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(uint32_t min_num_args, uint32_t max_num_args) /* {{{ */ { uint32_t num_args = ZEND_CALL_NUM_ARGS(EG(current_execute_data)); - char *func_name = get_active_function_or_method_name(); + zend_string *func_name = get_active_function_or_method_name(); zend_argument_count_error( - "%s(): %s %d argument%s %s expected, %d given", - func_name, min_num_args == max_num_args ? "Exactly" : num_args < min_num_args ? "At least" : "At most", + "%s() expects %s %d argument%s, %d given", + ZSTR_VAL(func_name), + min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most", num_args < min_num_args ? min_num_args : max_num_args, (num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s", - (num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "is" : "are", num_args ); - efree(func_name); + zend_string_release(func_name); } /* }}} */ @@ -325,7 +321,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_unexpected_extra_named_error(void) static ZEND_COLD void ZEND_FASTCALL zend_argument_error_variadic(zend_class_entry *error_ce, uint32_t arg_num, const char *format, va_list va) /* {{{ */ { - char *func_name; + zend_string *func_name; const char *arg_name; char *message = NULL; if (EG(exception)) { @@ -337,11 +333,11 @@ static ZEND_COLD void ZEND_FASTCALL zend_argument_error_variadic(zend_class_entr zend_vspprintf(&message, 0, format, va); zend_throw_error(error_ce, "%s(): Argument #%d%s%s%s %s", - func_name, arg_num, + ZSTR_VAL(func_name), arg_num, arg_name ? " ($" : "", arg_name ? arg_name : "", arg_name ? ")" : "", message ); efree(message); - efree(func_name); + zend_string_release(func_name); } /* }}} */ @@ -1005,16 +1001,17 @@ static zend_result zend_parse_va_args(uint32_t num_args, const char *type_spec, if (num_args < min_num_args || num_args > max_num_args) { if (!(flags & ZEND_PARSE_PARAMS_QUIET)) { - char *func_name = get_active_function_or_method_name(); - zend_argument_count_error("%s(): %s %d argument%s %s expected, %d given", - func_name, min_num_args == max_num_args ? "Exactly" : num_args < min_num_args ? "At least" : "At most", + zend_string *func_name = get_active_function_or_method_name(); + + zend_argument_count_error("%s() expects %s %d argument%s, %d given", + ZSTR_VAL(func_name), + min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most", num_args < min_num_args ? min_num_args : max_num_args, (num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s", - (num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "is" : "are", num_args ); - efree(func_name); + zend_string_release(func_name); } return FAILURE; } diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 50284b7026bd7..cc7f3ef19b3c7 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -313,8 +313,8 @@ ZEND_API const char *get_active_function_name(void); ZEND_API const char *get_function_name(const zend_function *func); ZEND_API const char *get_active_function_arg_name(uint32_t arg_num); ZEND_API const char *get_function_arg_name(const zend_function *func, uint32_t arg_num); -ZEND_API char *get_active_function_or_method_name(); -ZEND_API char *get_function_or_method_name(const zend_function *func); +ZEND_API zend_string *get_active_function_or_method_name(); +ZEND_API zend_string *get_function_or_method_name(const zend_function *func); ZEND_API const char *zend_get_executed_filename(void); ZEND_API zend_string *zend_get_executed_filename_ex(void); ZEND_API uint32_t zend_get_executed_lineno(void); diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index ceb87b312e58e..794f29a28602c 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -499,26 +499,25 @@ ZEND_API const char *get_function_name(const zend_function *func) /* {{{ */ } /* }}} */ -ZEND_API char *get_active_function_or_method_name(void) /* {{{ */ +ZEND_API zend_string *get_active_function_or_method_name(void) /* {{{ */ { if (!zend_is_executing()) { - return ""; + return zend_string_init("", 0, 0); } return get_function_or_method_name(EG(current_execute_data)->func); } /* }}} */ -ZEND_API char *get_function_or_method_name(const zend_function *func) /* {{{ */ +ZEND_API zend_string *get_function_or_method_name(const zend_function *func) /* {{{ */ { - char *name = NULL; - const char *class_name, *space; - - class_name = get_class_name(func, &space); + const char *name = get_function_name(func); - zend_spprintf(&name, 0, "%s%s%s", class_name, space, get_function_name(func)); + if (func->common.scope) { + return zend_create_member_string(func->common.scope->name, zend_string_init(name, strlen(name), 1)); + } - return name; + return zend_string_init(name, strlen(name), 0); } /* }}} */ diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 4d2c638469409..4d49ea2cdfe22 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -4594,16 +4594,16 @@ ZEND_VM_HOT_HANDLER(65, ZEND_SEND_VAL, CONST|TMPVAR, CONST|UNUSED|NUM) ZEND_VM_COLD_HELPER(zend_cannot_pass_by_ref_helper, ANY, ANY, uint32_t _arg_num, zval *_arg) { USE_OPLINE - char *func_name = get_function_or_method_name(EX(call)->func); + zend_string *func_name = get_function_or_method_name(EX(call)->func); const char *param_name = get_function_arg_name(EX(call)->func, _arg_num); SAVE_OPLINE(); zend_throw_error(NULL, "%s(): Argument #%d%s%s%s cannot be passed by reference", - func_name, _arg_num, param_name ? " ($" : "", + ZSTR_VAL(func_name), _arg_num, param_name ? " ($" : "", param_name ? param_name : "", param_name ? ")" : "" ); - efree(func_name); + zend_string_release(func_name); FREE_OP1(); ZVAL_UNDEF(_arg); HANDLE_EXCEPTION(); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index f0fe1ef69da59..c85213fb21a77 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -2281,16 +2281,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_CREATE_SPEC_HANDLER( static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_cannot_pass_by_ref_helper_SPEC(uint32_t _arg_num, zval *_arg ZEND_OPCODE_HANDLER_ARGS_DC) { USE_OPLINE - char *func_name = get_function_or_method_name(EX(call)->func); + zend_string *func_name = get_function_or_method_name(EX(call)->func); const char *param_name = get_function_arg_name(EX(call)->func, _arg_num); SAVE_OPLINE(); zend_throw_error(NULL, "%s(): Argument #%d%s%s%s cannot be passed by reference", - func_name, _arg_num, param_name ? " ($" : "", + ZSTR_VAL(func_name), _arg_num, param_name ? " ($" : "", param_name ? param_name : "", param_name ? ")" : "" ); - efree(func_name); + zend_string_release(func_name); FREE_OP(opline->op1_type, opline->op1.var); ZVAL_UNDEF(_arg); HANDLE_EXCEPTION(); diff --git a/ext/date/tests/DateTimeZone_construct_error.phpt b/ext/date/tests/DateTimeZone_construct_error.phpt index 711349ff5748e..dd0b1bb70893e 100644 --- a/ext/date/tests/DateTimeZone_construct_error.phpt +++ b/ext/date/tests/DateTimeZone_construct_error.phpt @@ -21,4 +21,4 @@ try { *** Testing DateTimeZone() : error conditions *** -- Testing new DateTimeZone() with more than expected no. of arguments -- -DateTimeZone::__construct(): Exactly 1 argument is expected, 2 given +DateTimeZone::__construct() expects exactly 1 argument, 2 given diff --git a/ext/date/tests/DateTime_construct_error.phpt b/ext/date/tests/DateTime_construct_error.phpt index 16cf16216d290..56ab1f3003ff5 100644 --- a/ext/date/tests/DateTime_construct_error.phpt +++ b/ext/date/tests/DateTime_construct_error.phpt @@ -22,4 +22,4 @@ try { *** Testing date_create() : error conditions *** -- Testing new DateTime() with more than expected no. of arguments -- -DateTime::__construct(): At most 2 arguments are expected, 3 given +DateTime::__construct() expects at most 2 arguments, 3 given diff --git a/ext/date/tests/mktime_error.phpt b/ext/date/tests/mktime_error.phpt index e567838c499fa..5bd1421369b9c 100644 --- a/ext/date/tests/mktime_error.phpt +++ b/ext/date/tests/mktime_error.phpt @@ -33,7 +33,7 @@ try { *** Testing mktime() : error conditions *** -- Testing mktime() function with Zero arguments -- -mktime(): At least 1 argument is expected, 0 given +mktime() expects at least 1 argument, 0 given -- Testing mktime() function with more than expected no. of arguments -- -mktime(): At most 6 arguments are expected, 7 given +mktime() expects at most 6 arguments, 7 given diff --git a/ext/dom/tests/DOMAttr_construct_error_001.phpt b/ext/dom/tests/DOMAttr_construct_error_001.phpt index 3540862c31ad0..cd84bd6b205a4 100644 --- a/ext/dom/tests/DOMAttr_construct_error_001.phpt +++ b/ext/dom/tests/DOMAttr_construct_error_001.phpt @@ -14,4 +14,4 @@ try { } ?> --EXPECT-- -DOMAttr::__construct(): At least 1 argument is expected, 0 given +DOMAttr::__construct() expects at least 1 argument, 0 given diff --git a/ext/dom/tests/DOMCDATASection_construct_error_001.phpt b/ext/dom/tests/DOMCDATASection_construct_error_001.phpt index 61a63745de42e..80328397569aa 100644 --- a/ext/dom/tests/DOMCDATASection_construct_error_001.phpt +++ b/ext/dom/tests/DOMCDATASection_construct_error_001.phpt @@ -14,4 +14,4 @@ Nic Rosental nicrosental@gmail.com } ?> --EXPECT-- -DOMCdataSection::__construct(): Exactly 1 argument is expected, 0 given +DOMCdataSection::__construct() expects exactly 1 argument, 0 given diff --git a/ext/dom/tests/DOMComment_construct_error_001.phpt b/ext/dom/tests/DOMComment_construct_error_001.phpt index 9f508429a9b59..e2c3b3c48f260 100644 --- a/ext/dom/tests/DOMComment_construct_error_001.phpt +++ b/ext/dom/tests/DOMComment_construct_error_001.phpt @@ -14,4 +14,4 @@ try { } ?> --EXPECT-- -DOMComment::__construct(): At most 1 argument is expected, 2 given +DOMComment::__construct() expects at most 1 argument, 2 given diff --git a/ext/dom/tests/DOMDocumentFragment_construct_error_001.phpt b/ext/dom/tests/DOMDocumentFragment_construct_error_001.phpt index 819306566cc27..89a1ecf6f2483 100644 --- a/ext/dom/tests/DOMDocumentFragment_construct_error_001.phpt +++ b/ext/dom/tests/DOMDocumentFragment_construct_error_001.phpt @@ -14,4 +14,4 @@ try { } ?> --EXPECT-- -DOMDocumentFragment::__construct() expects exactly 0 parameters, 1 given +DOMDocumentFragment::__construct() expects exactly 0 arguments, 1 given diff --git a/ext/fileinfo/tests/bug61173.phpt b/ext/fileinfo/tests/bug61173.phpt index 6f6e8177961e0..b96e08662d3b1 100644 --- a/ext/fileinfo/tests/bug61173.phpt +++ b/ext/fileinfo/tests/bug61173.phpt @@ -15,4 +15,4 @@ try { } ?> --EXPECT-- -finfo::__construct(): At most 2 arguments are expected, 3 given +finfo::__construct() expects at most 2 arguments, 3 given diff --git a/ext/imap/tests/imap_timeout_basic.phpt b/ext/imap/tests/imap_timeout_basic.phpt index afe1d2d081821..e1b958b3c77ef 100644 --- a/ext/imap/tests/imap_timeout_basic.phpt +++ b/ext/imap/tests/imap_timeout_basic.phpt @@ -41,7 +41,7 @@ var_dump(imap_timeout(IMAP_WRITETIMEOUT)); --EXPECTF-- Checking with no parameters -Warning: imap_timeout() expects at least 1 parameter, 0 given in %s on line %d +Warning: imap_timeout() expects at least 1 argument, 0 given in %s on line %d Checking with incorrect parameter type Warning: imap_timeout(): Argument #1 must be of type int, %s given in %s on line %d diff --git a/ext/intl/tests/breakiter___construct_error.phpt b/ext/intl/tests/breakiter___construct_error.phpt index f8ddadb53740b..a92d4a3ca8bbd 100644 --- a/ext/intl/tests/breakiter___construct_error.phpt +++ b/ext/intl/tests/breakiter___construct_error.phpt @@ -46,9 +46,9 @@ try { --EXPECTF-- Exception: IntlRuleBasedBreakIterator::__construct(): unable to create RuleBasedBreakIterator from rules (parse error on line 1, offset 31) in %s on line %d -Exception: IntlRuleBasedBreakIterator::__construct(): At least 1 argument is expected, 0 given in %s on line %d +Exception: IntlRuleBasedBreakIterator::__construct() expects at least 1 argument, 0 given in %s on line %d -Exception: IntlRuleBasedBreakIterator::__construct(): At most 2 arguments are expected, 3 given in %s on line %d +Exception: IntlRuleBasedBreakIterator::__construct() expects at most 2 arguments, 3 given in %s on line %d Exception: IntlRuleBasedBreakIterator::__construct(): Argument #2 ($areCompiled) must be of type bool, array given in %s on line %d diff --git a/ext/intl/tests/calendar_before_after_error.phpt b/ext/intl/tests/calendar_before_after_error.phpt index c0bd8a61bb75d..707ad08f0d636 100644 --- a/ext/intl/tests/calendar_before_after_error.phpt +++ b/ext/intl/tests/calendar_before_after_error.phpt @@ -62,18 +62,18 @@ try { } ?> --EXPECT-- -error: 0, IntlCalendar::after(): Exactly 1 argument is expected, 0 given +error: 0, IntlCalendar::after() expects exactly 1 argument, 0 given -error: 0, IntlCalendar::before(): Exactly 1 argument is expected, 0 given +error: 0, IntlCalendar::before() expects exactly 1 argument, 0 given error: 0, IntlCalendar::after(): Argument #1 ($calendar) must be of type IntlCalendar, int given error: 0, IntlCalendar::before(): Argument #1 ($calendar) must be of type IntlCalendar, int given -error: 0, IntlCalendar::after(): Exactly 1 argument is expected, 2 given +error: 0, IntlCalendar::after() expects exactly 1 argument, 2 given -error: 0, IntlCalendar::before(): Exactly 1 argument is expected, 2 given +error: 0, IntlCalendar::before() expects exactly 1 argument, 2 given -error: 0, intlcal_after(): Exactly 2 arguments are expected, 1 given +error: 0, intlcal_after() expects exactly 2 arguments, 1 given -error: 0, intlcal_before(): Exactly 2 arguments are expected, 1 given +error: 0, intlcal_before() expects exactly 2 arguments, 1 given diff --git a/ext/intl/tests/calendar_equals_error.phpt b/ext/intl/tests/calendar_equals_error.phpt index f25acd1035ced..177518e381f41 100644 --- a/ext/intl/tests/calendar_equals_error.phpt +++ b/ext/intl/tests/calendar_equals_error.phpt @@ -46,11 +46,11 @@ try { } ?> --EXPECT-- -error: 0, IntlCalendar::equals(): Exactly 1 argument is expected, 0 given +error: 0, IntlCalendar::equals() expects exactly 1 argument, 0 given error: 0, IntlCalendar::equals(): Argument #1 ($calendar) must be of type IntlCalendar, stdClass given -error: 0, IntlCalendar::equals(): Exactly 1 argument is expected, 2 given +error: 0, IntlCalendar::equals() expects exactly 1 argument, 2 given error: 0, intlcal_equals(): Argument #2 ($calendar) must be of type IntlCalendar, array given diff --git a/ext/intl/tests/calendar_fieldDifference_error.phpt b/ext/intl/tests/calendar_fieldDifference_error.phpt index 0ce5a1c8073dd..c43cbfe92f46e 100644 --- a/ext/intl/tests/calendar_fieldDifference_error.phpt +++ b/ext/intl/tests/calendar_fieldDifference_error.phpt @@ -27,11 +27,11 @@ try { var_dump(intlcal_field_difference(1, 0, 1)); ?> --EXPECTF-- -IntlCalendar::fieldDifference(): Exactly 2 arguments are expected, 3 given +IntlCalendar::fieldDifference() expects exactly 2 arguments, 3 given Warning: IntlCalendar::fieldDifference(): intlcal_field_difference: Call to ICU method has failed in %s on line %d bool(false) -intlcal_field_difference(): Exactly 3 arguments are expected, 4 given +intlcal_field_difference() expects exactly 3 arguments, 4 given Fatal error: Uncaught TypeError: intlcal_field_difference(): Argument #1 ($calendar) must be of type IntlCalendar, int given in %s:%d Stack trace: diff --git a/ext/intl/tests/calendar_getLocale_error.phpt b/ext/intl/tests/calendar_getLocale_error.phpt index 90adb903a40d7..a7711e45659a0 100644 --- a/ext/intl/tests/calendar_getLocale_error.phpt +++ b/ext/intl/tests/calendar_getLocale_error.phpt @@ -13,7 +13,7 @@ ini_set("intl.error_level", E_WARNING); var_dump(intlcal_get_locale(1)); ?> --EXPECTF-- -Fatal error: Uncaught ArgumentCountError: intlcal_get_locale(): Exactly 2 arguments are expected, 1 given in %s:%d +Fatal error: Uncaught ArgumentCountError: intlcal_get_locale() expects exactly 2 arguments, 1 given in %s:%d Stack trace: #0 %s(%d): intlcal_get_locale(1) #1 {main} diff --git a/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt b/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt index fe377be47d2e6..afc3df210a293 100644 --- a/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt +++ b/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt @@ -76,15 +76,15 @@ try { } ?> --EXPECT-- -ArgumentCountError: 0, intlcal_get(): Exactly 2 arguments are expected, 1 given -ArgumentCountError: 0, intlcal_get_actual_maximum(): Exactly 2 arguments are expected, 1 given -ArgumentCountError: 0, intlcal_get_actual_minimum(): Exactly 2 arguments are expected, 1 given +ArgumentCountError: 0, intlcal_get() expects exactly 2 arguments, 1 given +ArgumentCountError: 0, intlcal_get_actual_maximum() expects exactly 2 arguments, 1 given +ArgumentCountError: 0, intlcal_get_actual_minimum() expects exactly 2 arguments, 1 given ValueError: 0, intlcal_get(): Argument #2 ($field) must be a valid field ValueError: 0, intlcal_get_actual_maximum(): Argument #2 ($field) must be a valid field ValueError: 0, intlcal_get_actual_minimum(): Argument #2 ($field) must be a valid field TypeError: 0, intlcal_get(): Argument #2 ($field) must be of type int, string given TypeError: 0, intlcal_get_actual_maximum(): Argument #2 ($field) must be of type int, string given TypeError: 0, intlcal_get_actual_minimum(): Argument #2 ($field) must be of type int, string given -ArgumentCountError: 0, intlcal_get(): Exactly 2 arguments are expected, 1 given -ArgumentCountError: 0, intlcal_get_actual_maximum(): Exactly 2 arguments are expected, 1 given -ArgumentCountError: 0, intlcal_get_actual_minimum(): Exactly 2 arguments are expected, 1 given +ArgumentCountError: 0, intlcal_get() expects exactly 2 arguments, 1 given +ArgumentCountError: 0, intlcal_get_actual_maximum() expects exactly 2 arguments, 1 given +ArgumentCountError: 0, intlcal_get_actual_minimum() expects exactly 2 arguments, 1 given diff --git a/ext/intl/tests/calendar_isEquivalentTo_error.phpt b/ext/intl/tests/calendar_isEquivalentTo_error.phpt index 05b13d54d92b5..a387b8cbd0d03 100644 --- a/ext/intl/tests/calendar_isEquivalentTo_error.phpt +++ b/ext/intl/tests/calendar_isEquivalentTo_error.phpt @@ -52,11 +52,11 @@ try { --EXPECT-- error: 0, IntlCalendar::isEquivalentTo(): Argument #1 ($calendar) must be of type IntlCalendar, int given -error: 0, IntlCalendar::isEquivalentTo(): Exactly 1 argument is expected, 2 given +error: 0, IntlCalendar::isEquivalentTo() expects exactly 1 argument, 2 given error: 0, IntlCalendar::isEquivalentTo(): Argument #1 ($calendar) must be of type IntlCalendar, int given -error: 0, intlcal_is_equivalent_to(): Exactly 2 arguments are expected, 1 given +error: 0, intlcal_is_equivalent_to() expects exactly 2 arguments, 1 given error: 0, intlcal_is_equivalent_to(): Argument #2 ($calendar) must be of type IntlCalendar, int given diff --git a/ext/intl/tests/calendar_setTimeZone_error.phpt b/ext/intl/tests/calendar_setTimeZone_error.phpt index 4c7bd40961598..0890d160c813a 100644 --- a/ext/intl/tests/calendar_setTimeZone_error.phpt +++ b/ext/intl/tests/calendar_setTimeZone_error.phpt @@ -42,10 +42,10 @@ try{ } ?> --EXPECT-- -error: 0, IntlCalendar::setTimeZone(): Exactly 1 argument is expected, 2 given +error: 0, IntlCalendar::setTimeZone() expects exactly 1 argument, 2 given -error: 0, IntlCalendar::setTimeZone(): Exactly 1 argument is expected, 0 given +error: 0, IntlCalendar::setTimeZone() expects exactly 1 argument, 0 given -error: 0, intlcal_set_time_zone(): Exactly 2 arguments are expected, 3 given +error: 0, intlcal_set_time_zone() expects exactly 2 arguments, 3 given error: 0, intlcal_set_time_zone(): Argument #1 ($calendar) must be of type IntlCalendar, int given diff --git a/ext/intl/tests/calendar_setTime_error.phpt b/ext/intl/tests/calendar_setTime_error.phpt index 6e48fe6df4622..64a2cdfb82163 100644 --- a/ext/intl/tests/calendar_setTime_error.phpt +++ b/ext/intl/tests/calendar_setTime_error.phpt @@ -13,7 +13,7 @@ ini_set("intl.error_level", E_WARNING); var_dump(intlcal_set_time(1)); ?> --EXPECTF-- -Fatal error: Uncaught ArgumentCountError: intlcal_set_time(): Exactly 2 arguments are expected, 1 given in %s:%d +Fatal error: Uncaught ArgumentCountError: intlcal_set_time() expects exactly 2 arguments, 1 given in %s:%d Stack trace: #0 %s(%d): intlcal_set_time(1) #1 {main} diff --git a/ext/intl/tests/calendar_set_error.phpt b/ext/intl/tests/calendar_set_error.phpt index 7f3e71ede565e..1ebd40164b9ad 100644 --- a/ext/intl/tests/calendar_set_error.phpt +++ b/ext/intl/tests/calendar_set_error.phpt @@ -43,7 +43,7 @@ try { } ?> --EXPECT-- -IntlCalendar::set(): At most 6 arguments are expected, 7 given +IntlCalendar::set() expects at most 6 arguments, 7 given IntlCalendar::set() has no variant with exactly 4 parameters IntlCalendar::set(): Argument #1 ($year) must be a valid field intlcal_set(): Argument #2 ($year) must be a valid field diff --git a/ext/intl/tests/formatter_fail.phpt b/ext/intl/tests/formatter_fail.phpt index e08500089abc0..937a52f0989cb 100644 --- a/ext/intl/tests/formatter_fail.phpt +++ b/ext/intl/tests/formatter_fail.phpt @@ -95,13 +95,13 @@ foreach($args as $arg) { ?> --EXPECTF-- -ArgumentCountError: NumberFormatter::__construct(): At least 2 arguments are expected, 0 given in %s on line %d +ArgumentCountError: NumberFormatter::__construct() expects at least 2 arguments, 0 given in %s on line %d 'U_ZERO_ERROR' -ArgumentCountError: numfmt_create(): At least 2 arguments are expected, 0 given in %s on line %d +ArgumentCountError: numfmt_create() expects at least 2 arguments, 0 given in %s on line %d 'U_ZERO_ERROR' -ArgumentCountError: NumberFormatter::create(): At least 2 arguments are expected, 0 given in %s on line %d +ArgumentCountError: NumberFormatter::create() expects at least 2 arguments, 0 given in %s on line %d 'U_ZERO_ERROR' Error: NumberFormatter object is already constructed in %s on line %d diff --git a/ext/intl/tests/msgfmt_fail2.phpt b/ext/intl/tests/msgfmt_fail2.phpt index 87a505832a5b7..4061eab3dc4d1 100644 --- a/ext/intl/tests/msgfmt_fail2.phpt +++ b/ext/intl/tests/msgfmt_fail2.phpt @@ -108,22 +108,22 @@ foreach($args as $arg) { ?> --EXPECTF-- -ArgumentCountError: MessageFormatter::__construct(): Exactly 2 arguments are expected, 0 given in %s on line %d +ArgumentCountError: MessageFormatter::__construct() expects exactly 2 arguments, 0 given in %s on line %d 'U_ZERO_ERROR' -ArgumentCountError: msgfmt_create(): Exactly 2 arguments are expected, 0 given in %s on line %d +ArgumentCountError: msgfmt_create() expects exactly 2 arguments, 0 given in %s on line %d 'U_ZERO_ERROR' -ArgumentCountError: MessageFormatter::create(): Exactly 2 arguments are expected, 0 given in %s on line %d +ArgumentCountError: MessageFormatter::create() expects exactly 2 arguments, 0 given in %s on line %d 'U_ZERO_ERROR' -ArgumentCountError: MessageFormatter::__construct(): Exactly 2 arguments are expected, 1 given in %s on line %d +ArgumentCountError: MessageFormatter::__construct() expects exactly 2 arguments, 1 given in %s on line %d 'U_ZERO_ERROR' -ArgumentCountError: msgfmt_create(): Exactly 2 arguments are expected, 1 given in %s on line %d +ArgumentCountError: msgfmt_create() expects exactly 2 arguments, 1 given in %s on line %d 'U_ZERO_ERROR' -ArgumentCountError: MessageFormatter::create(): Exactly 2 arguments are expected, 1 given in %s on line %d +ArgumentCountError: MessageFormatter::create() expects exactly 2 arguments, 1 given in %s on line %d 'U_ZERO_ERROR' IntlException: Constructor failed in %s on line %d diff --git a/ext/json/tests/json_last_error_error.phpt b/ext/json/tests/json_last_error_error.phpt index d5c9b12232003..d98d1988dbac0 100644 --- a/ext/json/tests/json_last_error_error.phpt +++ b/ext/json/tests/json_last_error_error.phpt @@ -14,4 +14,4 @@ try { ?> --EXPECT-- int(0) -json_last_error() expects exactly 0 parameters, 1 given +json_last_error() expects exactly 0 arguments, 1 given diff --git a/ext/json/tests/json_last_error_msg_error.phpt b/ext/json/tests/json_last_error_msg_error.phpt index 61e5e1fcc5960..f34cdbbe624c6 100644 --- a/ext/json/tests/json_last_error_msg_error.phpt +++ b/ext/json/tests/json_last_error_msg_error.phpt @@ -14,4 +14,4 @@ try { ?> --EXPECT-- string(8) "No error" -json_last_error_msg() expects exactly 0 parameters, 1 given +json_last_error_msg() expects exactly 0 arguments, 1 given diff --git a/ext/mysqli/tests/mysqli_connect_errno.phpt b/ext/mysqli/tests/mysqli_connect_errno.phpt index f542ba88e89c5..2bc86de5ccb8b 100644 --- a/ext/mysqli/tests/mysqli_connect_errno.phpt +++ b/ext/mysqli/tests/mysqli_connect_errno.phpt @@ -40,5 +40,5 @@ require_once('skipifconnectfailure.inc'); print "done!"; ?> --EXPECT-- -mysqli_connect_errno() expects exactly 0 parameters, 1 given +mysqli_connect_errno() expects exactly 0 arguments, 1 given done! diff --git a/ext/mysqli/tests/mysqli_connect_error.phpt b/ext/mysqli/tests/mysqli_connect_error.phpt index 0f51d15dfd536..6643ed27f092d 100644 --- a/ext/mysqli/tests/mysqli_connect_error.phpt +++ b/ext/mysqli/tests/mysqli_connect_error.phpt @@ -39,5 +39,5 @@ require_once('skipifconnectfailure.inc'); print "done!"; ?> --EXPECT-- -mysqli_connect_error() expects exactly 0 parameters, 1 given +mysqli_connect_error() expects exactly 0 arguments, 1 given done! diff --git a/ext/mysqli/tests/mysqli_fetch_object_oo.phpt b/ext/mysqli/tests/mysqli_fetch_object_oo.phpt index c5d6430a35606..18aeb264ece95 100644 --- a/ext/mysqli/tests/mysqli_fetch_object_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_object_oo.phpt @@ -134,7 +134,7 @@ require_once('skipifconnectfailure.inc'); --EXPECTF-- mysqli object is not fully initialized [0] Object of class mysqli could not be converted to string in %s on line %d -[0] mysqli_result::fetch_object(): At most 2 arguments are expected, 3 given in %s on line %d +[0] mysqli_result::fetch_object() expects at most 2 arguments, 3 given in %s on line %d [0] mysqli_result::fetch_object(): Argument #2 ($params) must be of type array, null given in %s on line %d Exception: Too few arguments to function mysqli_fetch_object_construct::__construct(), 1 passed and exactly 2 expected NULL diff --git a/ext/mysqli/tests/mysqli_pconn_max_links.phpt b/ext/mysqli/tests/mysqli_pconn_max_links.phpt index b8be6f121cd5c..4e5283a19fdce 100644 --- a/ext/mysqli/tests/mysqli_pconn_max_links.phpt +++ b/ext/mysqli/tests/mysqli_pconn_max_links.phpt @@ -208,7 +208,7 @@ mysqli_query($link, 'DROP USER pcontest'); mysqli_close($link); ?> --EXPECT-- -mysqli_get_links_stats() expects exactly 0 parameters, 1 given +mysqli_get_links_stats() expects exactly 0 arguments, 1 given Before pconnect:array(3) { ["total"]=> int(1) @@ -261,7 +261,7 @@ array(2) { ["label"]=> string(1) "a" } -[015] Can open more persistent connections than allowed, [0] +[015] Can open more persistent connections than allowed, [0] array(3) { ["total"]=> int(3) diff --git a/ext/oci8/tests/array_bind_013.phpt b/ext/oci8/tests/array_bind_013.phpt index a04bccf30423b..1e5f826c00e79 100644 --- a/ext/oci8/tests/array_bind_013.phpt +++ b/ext/oci8/tests/array_bind_013.phpt @@ -28,7 +28,7 @@ var_dump($array); echo "Done\n"; ?> --EXPECTF-- -oci_bind_array_by_name() expects at most 6 parameters, 7 given +oci_bind_array_by_name() expects at most 6 arguments, 7 given Warning: oci_bind_array_by_name(): You must provide max length value for empty arrays in %s on line %d bool(false) diff --git a/ext/opcache/jit/zend_jit_helpers.c b/ext/opcache/jit/zend_jit_helpers.c index 796170c4086fd..c5c3cba9d0070 100644 --- a/ext/opcache/jit/zend_jit_helpers.c +++ b/ext/opcache/jit/zend_jit_helpers.c @@ -1772,13 +1772,14 @@ static void ZEND_FASTCALL zend_jit_only_vars_by_reference(zval *arg) static void ZEND_FASTCALL zend_jit_cannot_pass_by_reference(uint32_t arg_num) { const zend_execute_data *execute_data = EG(current_execute_data); - char *func_name = get_function_or_method_name(EX(call)->func); + zend_string *func_name = get_function_or_method_name(EX(call)->func); const char *param_name = get_function_arg_name(EX(call)->func, arg_num); zend_throw_error(NULL, "%s(): Argument #%d%s%s%s cannot be passed by reference", - func_name, arg_num, param_name ? " ($" : "", param_name ? param_name : "", param_name ? ")" : "" + ZSTR_VAL(func_name), arg_num, param_name ? " ($" : "", param_name ? param_name : "", param_name ? ")" : "" ); - efree(func_name); + + zend_string_release(func_name); } static void ZEND_FASTCALL zend_jit_invalid_array_access(zval *container) diff --git a/ext/pdo_oci/tests/pdo_oci_stmt_getcolumnmeta.phpt b/ext/pdo_oci/tests/pdo_oci_stmt_getcolumnmeta.phpt index 1b566be3e3b83..68a7142353294 100644 --- a/ext/pdo_oci/tests/pdo_oci_stmt_getcolumnmeta.phpt +++ b/ext/pdo_oci/tests/pdo_oci_stmt_getcolumnmeta.phpt @@ -39,7 +39,7 @@ SQL printf("[002] Expecting false got %s\n", var_export($tmp, true)); $stmt->execute(); - // Warning: PDOStatement::getColumnMeta() expects exactly 1 parameter, 0 given in + // Warning: PDOStatement::getColumnMeta() expects exactly 1 argument, 0 given in if (false !== ($tmp = @$stmt->getColumnMeta())) printf("[003] Expecting false got %s\n", var_export($tmp, true)); @@ -51,7 +51,7 @@ SQL if (false !== ($tmp = @$stmt->getColumnMeta(array()))) printf("[005] Expecting false got %s\n", var_export($tmp, true)); - // Warning: PDOStatement::getColumnMeta() expects exactly 1 parameter, 2 given in + // Warning: PDOStatement::getColumnMeta() expects exactly 1 argument, 2 given in if (false !== ($tmp = @$stmt->getColumnMeta(1, 1))) printf("[006] Expecting false got %s\n", var_export($tmp, true)); diff --git a/ext/phar/tests/002.phpt b/ext/phar/tests/002.phpt index 947295ebccf40..291c5a879d596 100644 --- a/ext/phar/tests/002.phpt +++ b/ext/phar/tests/002.phpt @@ -17,5 +17,5 @@ try { } __HALT_COMPILER(); ?> --EXPECTF-- -Phar::mapPhar(): At most 2 arguments are expected, 3 given +Phar::mapPhar() expects at most 2 arguments, 3 given internal corruption of phar "%s002.php" (truncated manifest at manifest length) diff --git a/ext/phar/tests/badparameters.phpt b/ext/phar/tests/badparameters.phpt index 187bb245c6d2d..746858c7c467e 100644 --- a/ext/phar/tests/badparameters.phpt +++ b/ext/phar/tests/badparameters.phpt @@ -253,16 +253,16 @@ Phar::compress(): Argument #1 ($compression_type) must be of type int, array giv Cannot compress phar archive, phar is read-only Phar::compressFiles(): Argument #1 ($compression_type) must be of type int, array given Phar is readonly, cannot change compression -Phar::copy(): Exactly 2 arguments are expected, 1 given +Phar::copy() expects exactly 2 arguments, 1 given Cannot copy "a" to "b", phar is read-only Phar::offsetExists(): Argument #1 ($entry) must be of type string, array given Phar::offsetGet(): Argument #1 ($entry) must be of type string, array given -Phar::offsetSet(): Exactly 2 arguments are expected, 1 given +Phar::offsetSet() expects exactly 2 arguments, 1 given PharData::offsetUnset(): Argument #1 ($entry) must be of type string, array given Write operations disabled by the php.ini setting phar.readonly Phar::addEmptyDir(): Argument #1 ($dirname) must be of type string, array given Phar::addFile(): Argument #1 ($filename) must be of type string, array given -Phar::addFromString(): Exactly 2 arguments are expected, 1 given +Phar::addFromString() expects exactly 2 arguments, 1 given Write operations disabled by the php.ini setting phar.readonly -Phar::setMetadata(): Exactly 1 argument is expected, 2 given +Phar::setMetadata() expects exactly 1 argument, 2 given Write operations disabled by the php.ini setting phar.readonly diff --git a/ext/phar/tests/bug60261.phpt b/ext/phar/tests/bug60261.phpt index b9cf93d4904e7..a616dfe253c67 100644 --- a/ext/phar/tests/bug60261.phpt +++ b/ext/phar/tests/bug60261.phpt @@ -14,4 +14,4 @@ try { ?> --EXPECT-- -Phar::__construct(): At least 1 argument is expected, 0 given +Phar::__construct() expects at least 1 argument, 0 given diff --git a/ext/reflection/tests/ReflectionClass_constructor_002.phpt b/ext/reflection/tests/ReflectionClass_constructor_002.phpt index 9bd4fa124be6a..7df620eaaa50e 100644 --- a/ext/reflection/tests/ReflectionClass_constructor_002.phpt +++ b/ext/reflection/tests/ReflectionClass_constructor_002.phpt @@ -46,10 +46,10 @@ try { ?> --EXPECT-- -ReflectionClass::__construct(): Exactly 1 argument is expected, 0 given +ReflectionClass::__construct() expects exactly 1 argument, 0 given Class "" does not exist Class "1" does not exist Class "1" does not exist ReflectionClass::__construct(): Argument #1 ($objectOrClass) must be of type object|string, array given -ReflectionClass::__construct(): Exactly 1 argument is expected, 2 given +ReflectionClass::__construct() expects exactly 1 argument, 2 given Class "X" does not exist diff --git a/ext/reflection/tests/ReflectionClass_getMethod_002.phpt b/ext/reflection/tests/ReflectionClass_getMethod_002.phpt index eeb68c63c52ff..827182288454f 100644 --- a/ext/reflection/tests/ReflectionClass_getMethod_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getMethod_002.phpt @@ -56,8 +56,8 @@ try { ?> --EXPECT-- Check invalid params: -ReflectionClass::getMethod(): Exactly 1 argument is expected, 0 given -ReflectionClass::getMethod(): Exactly 1 argument is expected, 2 given +ReflectionClass::getMethod() expects exactly 1 argument, 0 given +ReflectionClass::getMethod() expects exactly 1 argument, 2 given Method C::() does not exist Method C::1() does not exist Method C::1.5() does not exist diff --git a/ext/reflection/tests/ReflectionClass_getProperty_002.phpt b/ext/reflection/tests/ReflectionClass_getProperty_002.phpt index 19c9f0cb2dc8c..80ef77c8a3b62 100644 --- a/ext/reflection/tests/ReflectionClass_getProperty_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getProperty_002.phpt @@ -54,8 +54,8 @@ try { ?> --EXPECT-- Check invalid params: -ReflectionClass::getProperty(): Exactly 1 argument is expected, 0 given -ReflectionClass::getProperty(): Exactly 1 argument is expected, 2 given +ReflectionClass::getProperty() expects exactly 1 argument, 0 given +ReflectionClass::getProperty() expects exactly 1 argument, 2 given Property C::$ does not exist Property C::$1 does not exist Property C::$1.5 does not exist diff --git a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt index 6a2cd29d63bd5..4a5a5929d55ed 100644 --- a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt @@ -39,8 +39,8 @@ try { ?> --EXPECT-- -ReflectionClass::getStaticPropertyValue(): At most 2 arguments are expected, 3 given -ReflectionClass::getStaticPropertyValue(): At least 1 argument is expected, 0 given +ReflectionClass::getStaticPropertyValue() expects at most 2 arguments, 3 given +ReflectionClass::getStaticPropertyValue() expects at least 1 argument, 0 given Property C::$ does not exist string(3) "def" ReflectionClass::getStaticPropertyValue(): Argument #1 ($name) must be of type string, array given diff --git a/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt b/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt index 6ca0fed6d8de9..5fb158cb8d9a9 100644 --- a/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt +++ b/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt @@ -144,8 +144,8 @@ Does I2 implement I2? Test bad arguments: -ReflectionClass::implementsInterface(): Exactly 1 argument is expected, 0 given -ReflectionClass::implementsInterface(): Exactly 1 argument is expected, 2 given +ReflectionClass::implementsInterface() expects exactly 1 argument, 0 given +ReflectionClass::implementsInterface() expects exactly 1 argument, 2 given Interface "" does not exist Interface "ThisClassDoesNotExist" does not exist Interface "2" does not exist diff --git a/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt b/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt index d56dc80c564cb..51fc52b8ee6bd 100644 --- a/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt +++ b/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt @@ -37,8 +37,8 @@ try { ?> --EXPECT-- Test bad arguments: -ReflectionClass::isSubclassOf(): Exactly 1 argument is expected, 0 given -ReflectionClass::isSubclassOf(): Exactly 1 argument is expected, 2 given +ReflectionClass::isSubclassOf() expects exactly 1 argument, 0 given +ReflectionClass::isSubclassOf() expects exactly 1 argument, 2 given Class "" does not exist Class "ThisClassDoesNotExist" does not exist Class "2" does not exist diff --git a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt index 29ce40cb2c801..a33f96eb72364 100644 --- a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt +++ b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt @@ -44,9 +44,9 @@ try { ?> --EXPECT-- -ReflectionClass::setStaticPropertyValue(): Exactly 2 arguments are expected, 3 given -ReflectionClass::setStaticPropertyValue(): Exactly 2 arguments are expected, 0 given -ReflectionClass::setStaticPropertyValue(): Exactly 2 arguments are expected, 1 given -Class C does not have a property named +ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 3 given +ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 0 given +ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 1 given +Class C does not have a property named Class C does not have a property named 1.5 ReflectionClass::setStaticPropertyValue(): Argument #1 ($name) must be of type string, array given diff --git a/ext/reflection/tests/ReflectionExtension_constructor_error.phpt b/ext/reflection/tests/ReflectionExtension_constructor_error.phpt index 3413adc4b32cc..ccf2414e43e8e 100644 --- a/ext/reflection/tests/ReflectionExtension_constructor_error.phpt +++ b/ext/reflection/tests/ReflectionExtension_constructor_error.phpt @@ -25,7 +25,7 @@ try { ?> ---EXPECT-- -Ok - ReflectionExtension::__construct(): Exactly 1 argument is expected, 0 given -Ok - ReflectionExtension::__construct(): Exactly 1 argument is expected, 2 given +--EXPECTF-- +Ok - ReflectionExtension::__construct() expects exactly %d parameter, %d given +Ok - ReflectionExtension::__construct() expects exactly %d parameter, %d given Ok - ReflectionExtension::__construct(): Argument #1 ($name) must be of type string, array given diff --git a/ext/reflection/tests/ReflectionFunction_construct.001.phpt b/ext/reflection/tests/ReflectionFunction_construct.001.phpt index bdc8e15622ea1..f7020699d5647 100644 --- a/ext/reflection/tests/ReflectionFunction_construct.001.phpt +++ b/ext/reflection/tests/ReflectionFunction_construct.001.phpt @@ -37,6 +37,6 @@ try { --EXPECT-- Ok - ReflectionFunction::__construct(): Argument #1 ($function) must be of type Closure|string, array given Function nonExistentFunction() does not exist -Ok - ReflectionFunction::__construct(): Exactly 1 argument is expected, 0 given -Ok - ReflectionFunction::__construct(): Exactly 1 argument is expected, 2 given +Ok - ReflectionFunction::__construct() expects exactly 1 argument, 0 given +Ok - ReflectionFunction::__construct() expects exactly 1 argument, 2 given Ok - ReflectionFunction::__construct(): Argument #1 ($function) must be of type Closure|string, array given diff --git a/ext/reflection/tests/ReflectionMethod_006.phpt b/ext/reflection/tests/ReflectionMethod_006.phpt index 923d9a2befc0a..e32c73b8be82b 100644 --- a/ext/reflection/tests/ReflectionMethod_006.phpt +++ b/ext/reflection/tests/ReflectionMethod_006.phpt @@ -19,5 +19,5 @@ try { ?> --EXPECT-- -Ok - ReflectionMethod::__construct(): Exactly 1 argument is expected, 0 given -Ok - ReflectionMethod::__construct(): Exactly 1 argument is expected, 3 given +Ok - ReflectionMethod::__construct() expects exactly 1 argument, 0 given +Ok - ReflectionMethod::__construct() expects exactly 1 argument, 3 given diff --git a/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt b/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt index a26e83526680b..2a8b30bf036e5 100644 --- a/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt +++ b/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt @@ -52,10 +52,10 @@ try{ ?> --EXPECT-- Too few arguments: -Ok - ReflectionMethod::__construct(): Exactly 1 argument is expected, 0 given +Ok - ReflectionMethod::__construct() expects exactly 1 argument, 0 given Too many arguments: -Ok - ReflectionMethod::__construct(): Exactly 1 argument is expected, 3 given +Ok - ReflectionMethod::__construct() expects exactly 1 argument, 3 given Ok - Class "InvalidClassName" does not exist Ok - ReflectionMethod::__construct(): Argument #1 ($objectOrMethod) must be of type object|string, array given -Ok - ReflectionMethod::__construct(): Exactly 1 argument is expected, 2 given +Ok - ReflectionMethod::__construct() expects exactly 1 argument, 2 given diff --git a/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt b/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt index 1d3533679e681..92bd0543388b0 100644 --- a/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt +++ b/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt @@ -102,7 +102,7 @@ Called methodWithArgs(1, arg2) NULL Static method: -ReflectionMethod::invoke(): At least 1 argument is expected, 0 given +ReflectionMethod::invoke() expects at least 1 argument, 0 given ReflectionMethod::invoke(): Argument #1 ($object) must be of type ?object, bool given Called staticMethod() Exception: Using $this when not in object context diff --git a/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt b/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt index e06bee59b5755..ceedc7d4f0430 100644 --- a/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt +++ b/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt @@ -37,8 +37,8 @@ try { ?> --EXPECT-- Test bad arguments: -ReflectionClass::isSubclassOf(): Exactly 1 argument is expected, 0 given -ReflectionClass::isSubclassOf(): Exactly 1 argument is expected, 2 given +ReflectionClass::isSubclassOf() expects exactly 1 argument, 0 given +ReflectionClass::isSubclassOf() expects exactly 1 argument, 2 given Class "" does not exist Class "ThisClassDoesNotExist" does not exist Class "2" does not exist diff --git a/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt b/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt index a748062b99b52..917f079fd9049 100644 --- a/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt +++ b/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt @@ -43,6 +43,6 @@ echo "Done.\n"; Class "A" does not exist Method C::b() does not exist Method C::b() does not exist -Ok - ReflectionParameter::__construct(): Exactly 2 arguments are expected, 1 given +Ok - ReflectionParameter::__construct() expects exactly 2 arguments, 1 given Ok - ReflectionParameter::__construct(): Argument #1 ($function) must be either a string, an array(class, method) or a callable object, int given Done. diff --git a/ext/reflection/tests/ReflectionProperty_error.phpt b/ext/reflection/tests/ReflectionProperty_error.phpt index 00ef4d65a2b5e..bb53599ce67dd 100644 --- a/ext/reflection/tests/ReflectionProperty_error.phpt +++ b/ext/reflection/tests/ReflectionProperty_error.phpt @@ -26,6 +26,6 @@ try { ?> --EXPECT-- -Ok - ReflectionProperty::__construct(): Exactly 2 arguments are expected, 0 given -Ok - ReflectionProperty::__construct(): Exactly 2 arguments are expected, 1 given -Ok - ReflectionProperty::__construct(): Exactly 2 arguments are expected, 3 given +Ok - ReflectionProperty::__construct() expects exactly 2 arguments, 0 given +Ok - ReflectionProperty::__construct() expects exactly 2 arguments, 1 given +Ok - ReflectionProperty::__construct() expects exactly 2 arguments, 3 given diff --git a/ext/reflection/tests/ReflectionProperty_getValue_error.phpt b/ext/reflection/tests/ReflectionProperty_getValue_error.phpt index 86c8346c208b7..544c1d6b254f7 100644 --- a/ext/reflection/tests/ReflectionProperty_getValue_error.phpt +++ b/ext/reflection/tests/ReflectionProperty_getValue_error.phpt @@ -57,7 +57,7 @@ try { Instance without property: Static property / too many args: -ReflectionProperty::getValue(): At most 1 argument is expected, 2 given +ReflectionProperty::getValue() expects at most 1 argument, 2 given Protected property: Cannot access non-public property TestClass::$prot diff --git a/ext/session/tests/session_set_save_handler_class_012.phpt b/ext/session/tests/session_set_save_handler_class_012.phpt index f5d8d0ff00f15..af52919d8bd5d 100644 --- a/ext/session/tests/session_set_save_handler_class_012.phpt +++ b/ext/session/tests/session_set_save_handler_class_012.phpt @@ -42,10 +42,10 @@ var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i ?> --EXPECTF-- *** Testing session_set_save_handler() : incorrect arguments for existing handler open *** -Open +Open Warning: session_start(): Failed to initialize storage module: user (path: ) in %s on line %d -SessionHandler::open(): Exactly 2 arguments are expected, 0 given +SessionHandler::open() expects exactly 2 arguments, 0 given Warning: Undefined variable $_SESSION in %s on line %d string(0) "" diff --git a/ext/session/tests/session_set_save_handler_class_013.phpt b/ext/session/tests/session_set_save_handler_class_013.phpt index 1ef12bd1f36a8..2bd81ebc2e722 100644 --- a/ext/session/tests/session_set_save_handler_class_013.phpt +++ b/ext/session/tests/session_set_save_handler_class_013.phpt @@ -38,7 +38,7 @@ var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i ?> --EXPECTF-- *** Testing session_set_save_handler() : incorrect arguments for existing handler close *** -Open +Open Read %s string(%d) "%s" string(5) "files" @@ -47,7 +47,7 @@ int(2) array(0) { } -Fatal error: Uncaught ArgumentCountError: SessionHandler::close() expects exactly 0 parameters, 1 given in %s:%d +Fatal error: Uncaught ArgumentCountError: SessionHandler::close() expects exactly 0 arguments, 1 given in %s:%d Stack trace: #0 %s(%d): SessionHandler->close(false) #1 [internal function]: MySession->close() diff --git a/ext/snmp/tests/snmp-object-error.phpt b/ext/snmp/tests/snmp-object-error.phpt index 9185d8d576d18..a1268e4b4c7c0 100644 --- a/ext/snmp/tests/snmp-object-error.phpt +++ b/ext/snmp/tests/snmp-object-error.phpt @@ -69,7 +69,7 @@ $session->max_oids = 0; var_dump($session->max_oids); ?> --EXPECTF-- -SNMP::__construct() expects at least 3 parameters, 2 given +SNMP::__construct() expects at least 3 arguments, 2 given SNMP::__construct(): Argument #4 ($timeout) must be of type int, string given SNMP::__construct(): Argument #5 ($retries) must be of type int, string given SNMP::__construct(): Argument #1 ($version) must be a valid SNMP protocol version diff --git a/ext/soap/tests/bugs/bug31422.phpt b/ext/soap/tests/bugs/bug31422.phpt index 3bc0e1cee21f2..a7d3efcdb68a3 100644 --- a/ext/soap/tests/bugs/bug31422.phpt +++ b/ext/soap/tests/bugs/bug31422.phpt @@ -40,5 +40,5 @@ echo "ok\n"; ?> --EXPECT-- -SOAP-ENV:Serverfopen(): At least 2 arguments are expected, 0 given +SOAP-ENV:Serverfopen() expects at least 2 arguments, 0 given ok diff --git a/ext/sockets/tests/socket_connect_params.phpt b/ext/sockets/tests/socket_connect_params.phpt index 824c7e2168ab9..a73b270165474 100644 --- a/ext/sockets/tests/socket_connect_params.phpt +++ b/ext/sockets/tests/socket_connect_params.phpt @@ -31,7 +31,7 @@ $s_w = socket_connect($s_c, '0.0.0.0', $port); socket_close($s_c); ?> --EXPECTF-- -socket_connect(): At least 2 arguments are expected, 1 given +socket_connect() expects at least 2 arguments, 1 given socket_connect(): Argument #3 ($port) cannot be null when the socket type is AF_INET Warning: socket_connect(): unable to connect [%i]: %a in %s on line %d diff --git a/ext/sodium/tests/bug78114.phpt b/ext/sodium/tests/bug78114.phpt index d0145fa5a5a8c..6d7df4348faa9 100644 --- a/ext/sodium/tests/bug78114.phpt +++ b/ext/sodium/tests/bug78114.phpt @@ -13,4 +13,4 @@ try { } ?> --EXPECT-- -sodium_bin2hex(): Exactly 1 argument is expected, 0 given +sodium_bin2hex() expects exactly 1 argument, 0 given diff --git a/ext/spl/tests/AppendIterator_invalid_ctor.phpt b/ext/spl/tests/AppendIterator_invalid_ctor.phpt index ae22270615af0..3c030632bfaef 100644 --- a/ext/spl/tests/AppendIterator_invalid_ctor.phpt +++ b/ext/spl/tests/AppendIterator_invalid_ctor.phpt @@ -7,7 +7,7 @@ new AppendIterator(null); ?> --EXPECTF-- -Fatal error: Uncaught ArgumentCountError: AppendIterator::__construct() expects exactly 0 parameters, 1 given in %s:%d +Fatal error: Uncaught ArgumentCountError: AppendIterator::__construct() expects exactly 0 arguments, 1 given in %s:%d Stack trace: #0 %s(%d): AppendIterator->__construct(NULL) #1 {main} diff --git a/ext/spl/tests/CallbackFilterIteratorTest-002.phpt b/ext/spl/tests/CallbackFilterIteratorTest-002.phpt index 6b74aa5863fef..b8a612f303c77 100644 --- a/ext/spl/tests/CallbackFilterIteratorTest-002.phpt +++ b/ext/spl/tests/CallbackFilterIteratorTest-002.phpt @@ -42,8 +42,8 @@ try { } ?> --EXPECT-- -CallbackFilterIterator::__construct(): Exactly 2 arguments are expected, 0 given -CallbackFilterIterator::__construct(): Exactly 2 arguments are expected, 1 given +CallbackFilterIterator::__construct() expects exactly 2 arguments, 0 given +CallbackFilterIterator::__construct() expects exactly 2 arguments, 1 given CallbackFilterIterator::__construct(): Argument #2 ($callback) must be a valid callback, no array or string given CallbackFilterIterator::__construct(): Argument #2 ($callback) must be a valid callback, array must have exactly two members some message diff --git a/ext/spl/tests/arrayObject___construct_error2.phpt b/ext/spl/tests/arrayObject___construct_error2.phpt index 645f9e73ed0dc..7850a453b4340 100644 --- a/ext/spl/tests/arrayObject___construct_error2.phpt +++ b/ext/spl/tests/arrayObject___construct_error2.phpt @@ -19,4 +19,4 @@ try { ?> --EXPECT-- Too many arguments: -ArrayObject::__construct(): At most 3 arguments are expected, 4 given(12) +ArrayObject::__construct() expects at most 3 arguments, 4 given(12) diff --git a/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt b/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt index 6a51b9508e890..ee149ad19b835 100644 --- a/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt +++ b/ext/spl/tests/arrayObject_exchangeArray_basic3.phpt @@ -81,7 +81,7 @@ array(2) { --> exchangeArray() with no arg: -Exception: ArrayObject::exchangeArray(): Exactly 1 argument is expected, 0 given +Exception: ArrayObject::exchangeArray() expects exactly 1 argument, 0 given Warning: Undefined variable $copy in %s on line %d object(ArrayObject)#2 (1) { diff --git a/ext/spl/tests/arrayObject_natcasesort_basic1.phpt b/ext/spl/tests/arrayObject_natcasesort_basic1.phpt index 6cffe4a621035..9949fbda06aa8 100644 --- a/ext/spl/tests/arrayObject_natcasesort_basic1.phpt +++ b/ext/spl/tests/arrayObject_natcasesort_basic1.phpt @@ -38,7 +38,7 @@ object(ArrayObject)#1 (1) { string(5) "boo22" } } -ArrayObject::natcasesort() expects exactly 0 parameters, 1 given +ArrayObject::natcasesort() expects exactly 0 arguments, 1 given object(ArrayObject)#2 (1) { ["storage":"ArrayObject":private]=> array(5) { diff --git a/ext/spl/tests/arrayObject_natsort_basic1.phpt b/ext/spl/tests/arrayObject_natsort_basic1.phpt index 953e55ca2890a..474c142de0a44 100644 --- a/ext/spl/tests/arrayObject_natsort_basic1.phpt +++ b/ext/spl/tests/arrayObject_natsort_basic1.phpt @@ -38,7 +38,7 @@ object(ArrayObject)#1 (1) { string(5) "boo22" } } -ArrayObject::natsort() expects exactly 0 parameters, 1 given +ArrayObject::natsort() expects exactly 0 arguments, 1 given object(ArrayObject)#2 (1) { ["storage":"ArrayObject":private]=> array(5) { diff --git a/ext/spl/tests/arrayObject_uasort_error1.phpt b/ext/spl/tests/arrayObject_uasort_error1.phpt index 67a9f57633a1a..d4c8532451277 100644 --- a/ext/spl/tests/arrayObject_uasort_error1.phpt +++ b/ext/spl/tests/arrayObject_uasort_error1.phpt @@ -22,5 +22,5 @@ try { } ?> --EXPECT-- -ArrayObject::uasort(): Exactly 1 argument is expected, 0 given -ArrayObject::uasort(): Exactly 1 argument is expected, 2 given +ArrayObject::uasort() expects exactly 1 argument, 0 given +ArrayObject::uasort() expects exactly 1 argument, 2 given diff --git a/ext/spl/tests/arrayObject_uksort_error1.phpt b/ext/spl/tests/arrayObject_uksort_error1.phpt index 72d2c415718b4..13fb51960541b 100644 --- a/ext/spl/tests/arrayObject_uksort_error1.phpt +++ b/ext/spl/tests/arrayObject_uksort_error1.phpt @@ -22,5 +22,5 @@ try { } ?> --EXPECT-- -ArrayObject::uksort(): Exactly 1 argument is expected, 0 given -ArrayObject::uksort(): Exactly 1 argument is expected, 2 given +ArrayObject::uksort() expects exactly 1 arguments, 0 given +ArrayObject::uksort() expects exactly 1 argument, 2 given diff --git a/ext/spl/tests/iterator_056.phpt b/ext/spl/tests/iterator_056.phpt index 1a99f9d01f0b2..54a31d18baf49 100644 --- a/ext/spl/tests/iterator_056.phpt +++ b/ext/spl/tests/iterator_056.phpt @@ -56,9 +56,9 @@ try { ?> --EXPECT-- -FilterIterator::__construct(): Exactly 1 argument is expected, 0 given -CachingIterator::__construct(): At least 1 argument is expected, 0 given -RecursiveCachingIterator::__construct(): At least 1 argument is expected, 0 given -ParentIterator::__construct(): Exactly 1 argument is expected, 0 given -LimitIterator::__construct(): At least 1 argument is expected, 0 given -NoRewindIterator::__construct(): Exactly 1 argument is expected, 0 given +FilterIterator::__construct() expects exactly 1 argument, 0 given +CachingIterator::__construct() expects at least 1 argument, 0 given +RecursiveCachingIterator::__construct() expects at least 1 argument, 0 given +ParentIterator::__construct() expects exactly 1 argument, 0 given +LimitIterator::__construct() expects at least 1 argument, 0 given +NoRewindIterator::__construct() expects exactly 1 argument, 0 given diff --git a/ext/spl/tests/iterator_062.phpt b/ext/spl/tests/iterator_062.phpt index 18a42e08cb42e..904b7f0ccfdfa 100644 --- a/ext/spl/tests/iterator_062.phpt +++ b/ext/spl/tests/iterator_062.phpt @@ -15,4 +15,4 @@ try { } ?> --EXPECT-- -RecursiveIteratorIterator::__construct(): At least 1 argument is expected, 0 given +RecursiveIteratorIterator::__construct() expects at least 1 argument, 0 given diff --git a/ext/spl/tests/recursive_tree_iterator_002.phpt b/ext/spl/tests/recursive_tree_iterator_002.phpt index 2d54397b8ce87..01f12bf59538a 100644 --- a/ext/spl/tests/recursive_tree_iterator_002.phpt +++ b/ext/spl/tests/recursive_tree_iterator_002.phpt @@ -11,4 +11,4 @@ try { } ?> --EXPECT-- -RecursiveTreeIterator::__construct(): At least 1 argument is expected, 0 given +RecursiveTreeIterator::__construct() expects at least 1 argument, 0 given diff --git a/ext/spl/tests/spl_004.phpt b/ext/spl/tests/spl_004.phpt index ea3791dc90bdd..d87b114a67ce9 100644 --- a/ext/spl/tests/spl_004.phpt +++ b/ext/spl/tests/spl_004.phpt @@ -86,4 +86,4 @@ int(4) ===ERRORS=== iterator_apply(): Argument #3 ($args) must be of type ?array, int given iterator_apply(): Argument #2 ($function) must be a valid callback, function "non_existing_function" not found or invalid function name -iterator_apply(): At most 3 arguments are expected, 4 given +iterator_apply() expects at most 3 arguments, 4 given diff --git a/ext/spl/tests/spl_iterator_iterator_constructor.phpt b/ext/spl/tests/spl_iterator_iterator_constructor.phpt index c02eaad86f278..2349a13e31607 100644 --- a/ext/spl/tests/spl_iterator_iterator_constructor.phpt +++ b/ext/spl/tests/spl_iterator_iterator_constructor.phpt @@ -21,4 +21,4 @@ try { ?> --EXPECT-- -IteratorIterator::__construct(): At most 2 arguments are expected, 3 given +IteratorIterator::__construct() expects at most 2 arguments, 3 given diff --git a/ext/sqlite3/tests/sqlite3_02_open.phpt b/ext/sqlite3/tests/sqlite3_02_open.phpt index 26079df863e5f..7e7a73ffe00fd 100644 --- a/ext/sqlite3/tests/sqlite3_02_open.phpt +++ b/ext/sqlite3/tests/sqlite3_02_open.phpt @@ -16,4 +16,4 @@ try { ?> --EXPECT-- -string(64) "SQLite3::__construct(): At least 1 argument is expected, 0 given" +string(60) "SQLite3::__construct() expects at least 1 argument, 0 given" diff --git a/ext/standard/array.c b/ext/standard/array.c index 55b4e629ebee8..5dff220034fc0 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -4637,7 +4637,7 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa } if (argc < req_args) { - zend_argument_count_error("At least %d parameters are required, %d given", req_args, argc); + zend_argument_count_error("At least %d arguments are required, %d given", req_args, argc); RETURN_THROWS(); } @@ -4731,7 +4731,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int } if (ZEND_NUM_ARGS() < req_args) { - zend_argument_count_error("At least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS()); + zend_argument_count_error("At least %d arguments are required, %d given", req_args, ZEND_NUM_ARGS()); RETURN_THROWS(); } @@ -4783,7 +4783,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int } if (ZEND_NUM_ARGS() < req_args) { - zend_argument_count_error("At least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS()); + zend_argument_count_error("At least %d arguments are required, %d given", req_args, ZEND_NUM_ARGS()); RETURN_THROWS(); } @@ -5130,7 +5130,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ } if (ZEND_NUM_ARGS() < req_args) { - zend_argument_count_error("At least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS()); + zend_argument_count_error("At least %d arguments are required, %d given", req_args, ZEND_NUM_ARGS()); RETURN_THROWS(); } @@ -5182,7 +5182,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ } if (ZEND_NUM_ARGS() < req_args) { - zend_argument_count_error("At least %d parameters are required, %d given", req_args, ZEND_NUM_ARGS()); + zend_argument_count_error("At least %d arguments are required, %d given", req_args, ZEND_NUM_ARGS()); RETURN_THROWS(); } diff --git a/ext/standard/basic_functions_arginfo.h b/ext/standard/basic_functions_arginfo.h index 61a92dc185208..17ab235dbb8f8 100755 --- a/ext/standard/basic_functions_arginfo.h +++ b/ext/standard/basic_functions_arginfo.h @@ -1,5 +1,5 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: c51ad7a5f254f8d28f2b2c0b46e214c44f0f96cf */ + * Stub hash: 1d2a7229aa506c8da54ecbed6480836aa14fd484 */ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_set_time_limit, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, seconds, IS_LONG, 0) diff --git a/ext/standard/tests/array/array_diff_uassoc_error.phpt b/ext/standard/tests/array/array_diff_uassoc_error.phpt index fa083f345cafd..2eddc16d5b06a 100644 --- a/ext/standard/tests/array/array_diff_uassoc_error.phpt +++ b/ext/standard/tests/array/array_diff_uassoc_error.phpt @@ -49,4 +49,4 @@ array_diff_uassoc(): Argument #4 must be a valid callback, array must have exact array_diff_uassoc(): Argument #6 must be a valid callback, array must have exactly two members -- Testing array_diff_uassoc() function with less than expected no. of arguments -- -At least 3 parameters are required, 2 given +At least 3 arguments are required, 2 given diff --git a/ext/standard/tests/array/array_filter_variation10.phpt b/ext/standard/tests/array/array_filter_variation10.phpt index b896e639bf4ec..eef7b64620336 100644 --- a/ext/standard/tests/array/array_filter_variation10.phpt +++ b/ext/standard/tests/array/array_filter_variation10.phpt @@ -87,5 +87,5 @@ array(2) { ["b"]=> int(2) } -is_numeric(): Exactly 1 argument is expected, 2 given +is_numeric() expects exactly 1 argument, 2 given Done diff --git a/ext/standard/tests/array/array_intersect_assoc_error.phpt b/ext/standard/tests/array/array_intersect_assoc_error.phpt index 40d5bb3b16d77..db59d4e22d094 100644 --- a/ext/standard/tests/array/array_intersect_assoc_error.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_error.phpt @@ -27,8 +27,8 @@ echo "Done"; *** Testing array_intersect_assoc() : error conditions *** -- Testing array_intersect_assoc() function with Zero arguments -- -At least 2 parameters are required, 0 given +At least 2 arguments are required, 0 given -- Testing array_intersect_assoc() function with less than expected no. of arguments -- -At least 2 parameters are required, 1 given +At least 2 arguments are required, 1 given Done diff --git a/ext/standard/tests/array/array_intersect_error.phpt b/ext/standard/tests/array/array_intersect_error.phpt index 5ddfaa42f0719..623fd2f9a6312 100644 --- a/ext/standard/tests/array/array_intersect_error.phpt +++ b/ext/standard/tests/array/array_intersect_error.phpt @@ -27,8 +27,8 @@ echo "Done"; *** Testing array_intersect() : error conditions *** -- Testing array_intersect() function with Zero arguments -- -At least 2 parameters are required, 0 given +At least 2 arguments are required, 0 given -- Testing array_intersect() function with less than expected no. of arguments -- -At least 2 parameters are required, 1 given +At least 2 arguments are required, 1 given Done diff --git a/ext/standard/tests/array/array_intersect_key_error.phpt b/ext/standard/tests/array/array_intersect_key_error.phpt index 49df346972717..81961f3afcdc5 100644 --- a/ext/standard/tests/array/array_intersect_key_error.phpt +++ b/ext/standard/tests/array/array_intersect_key_error.phpt @@ -27,7 +27,7 @@ try { *** Testing array_intersect_key() : error conditions *** -- Testing array_intersect_key() function with less than expected no. of arguments -- -At least 2 parameters are required, 1 given +At least 2 arguments are required, 1 given -- Testing array_intersect_key() function with no arguments -- -At least 2 parameters are required, 0 given +At least 2 arguments are required, 0 given diff --git a/ext/standard/tests/array/array_map_error.phpt b/ext/standard/tests/array/array_map_error.phpt index e800bcbe4541f..7d1d6986aba59 100644 --- a/ext/standard/tests/array/array_map_error.phpt +++ b/ext/standard/tests/array/array_map_error.phpt @@ -37,7 +37,7 @@ echo "Done"; *** Testing array_map() : error conditions *** -- Testing array_map() function with one less than expected no. of arguments -- -Exception: array_map(): At least 2 arguments are expected, 1 given +Exception: array_map() expects at least 2 arguments, 1 given -- Testing array_map() function with less no. of arrays than callback function arguments -- Exception: Too few arguments to function callback2(), 1 passed and exactly 2 expected diff --git a/ext/standard/tests/array/array_map_variation12.phpt b/ext/standard/tests/array/array_map_variation12.phpt index 518d30a463f52..b642bd0cb50d6 100644 --- a/ext/standard/tests/array/array_map_variation12.phpt +++ b/ext/standard/tests/array/array_map_variation12.phpt @@ -42,7 +42,7 @@ array(3) { int(243) } -- with built-in function 'pow' and one parameter -- -pow(): Exactly 2 arguments are expected, 1 given +pow() expects exactly 2 arguments, 1 given -- with language construct -- array_map(): Argument #1 ($callback) must be a valid callback, function "echo" not found or invalid function name Done diff --git a/ext/standard/tests/array/array_walk_error2.phpt b/ext/standard/tests/array/array_walk_error2.phpt index 0399c272f43a8..57b082db95aff 100644 --- a/ext/standard/tests/array/array_walk_error2.phpt +++ b/ext/standard/tests/array/array_walk_error2.phpt @@ -56,5 +56,5 @@ Exception: Too few arguments to function callback2(), 3 passed and exactly 4 exp Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected -- Testing array_walk() function with too many callback parameters -- -Exception: array_walk(): At most 3 arguments are expected, 4 given +Exception: array_walk() expects at most 3 arguments, 4 given Done diff --git a/ext/standard/tests/array/array_walk_recursive_error2.phpt b/ext/standard/tests/array/array_walk_recursive_error2.phpt index 28e6fc1a9aa30..fa5161e5c1bd9 100644 --- a/ext/standard/tests/array/array_walk_recursive_error2.phpt +++ b/ext/standard/tests/array/array_walk_recursive_error2.phpt @@ -56,5 +56,5 @@ Exception: Too few arguments to function callback2(), 3 passed and exactly 4 exp Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected -- Testing array_walk_recursive() function with too many callback parameters -- -Exception: array_walk_recursive(): At most 3 arguments are expected, 4 given +Exception: array_walk_recursive() expects at most 3 arguments, 4 given Done diff --git a/ext/standard/tests/general_functions/error_get_last.phpt b/ext/standard/tests/general_functions/error_get_last.phpt index 9bdefc334b5dc..1e7516970ef07 100644 --- a/ext/standard/tests/general_functions/error_get_last.phpt +++ b/ext/standard/tests/general_functions/error_get_last.phpt @@ -19,7 +19,7 @@ echo "Done\n"; ?> --EXPECTF-- NULL -error_get_last() expects exactly 0 parameters, 1 given +error_get_last() expects exactly 0 arguments, 1 given NULL Warning: Undefined variable $b in %s on line %d diff --git a/ext/standard/tests/password/password_hash_error.phpt b/ext/standard/tests/password/password_hash_error.phpt index b7a4784eababd..a9e26f091675e 100644 --- a/ext/standard/tests/password/password_hash_error.phpt +++ b/ext/standard/tests/password/password_hash_error.phpt @@ -36,7 +36,7 @@ try { ?> --EXPECT-- -password_hash(): At least 2 arguments are expected, 1 given +password_hash() expects at least 2 arguments, 1 given password_hash(): Argument #2 ($algo) must be of type string|int|null, array given password_hash(): Argument #3 ($options) must be of type array, stdClass given password_hash(): Argument #3 ($options) must be of type array, string given diff --git a/ext/standard/tests/password/password_needs_rehash_error.phpt b/ext/standard/tests/password/password_needs_rehash_error.phpt index 227ab516e6130..283a6b5387e03 100644 --- a/ext/standard/tests/password/password_needs_rehash_error.phpt +++ b/ext/standard/tests/password/password_needs_rehash_error.phpt @@ -30,7 +30,7 @@ try { echo "OK!"; ?> --EXPECT-- -password_needs_rehash(): At least 2 arguments are expected, 1 given +password_needs_rehash() expects at least 2 arguments, 1 given password_needs_rehash(): Argument #2 ($algo) must be of type string|int|null, array given password_needs_rehash(): Argument #1 ($hash) must be of type string, array given password_needs_rehash(): Argument #3 ($options) must be of type array, string given diff --git a/ext/standard/tests/password/password_verify_error.phpt b/ext/standard/tests/password/password_verify_error.phpt index 2cb6925cbb205..76c4f6dcb65e8 100644 --- a/ext/standard/tests/password/password_verify_error.phpt +++ b/ext/standard/tests/password/password_verify_error.phpt @@ -12,4 +12,4 @@ try { ?> --EXPECT-- -password_verify(): Exactly 2 arguments are expected, 1 given +password_verify() expects exactly 2 arguments, 1 given diff --git a/ext/standard/tests/random/random_bytes_error.phpt b/ext/standard/tests/random/random_bytes_error.phpt index 51cca7c9b6751..bc0c1ccc20489 100644 --- a/ext/standard/tests/random/random_bytes_error.phpt +++ b/ext/standard/tests/random/random_bytes_error.phpt @@ -18,5 +18,5 @@ try { ?> --EXPECT-- -random_bytes(): Exactly 1 argument is expected, 0 given +random_bytes() expects exactly 1 argument, 0 given random_bytes(): Argument #1 ($length) must be greater than 0 diff --git a/ext/standard/tests/random/random_int_error.phpt b/ext/standard/tests/random/random_int_error.phpt index c6f4864987e13..fe461275c9518 100644 --- a/ext/standard/tests/random/random_int_error.phpt +++ b/ext/standard/tests/random/random_int_error.phpt @@ -24,6 +24,6 @@ try { ?> --EXPECT-- -random_int(): Exactly 2 arguments are expected, 0 given -random_int(): Exactly 2 arguments are expected, 1 given +random_int() expects exactly 2 arguments, 0 given +random_int() expects exactly 2 arguments, 1 given random_int(): Argument #1 ($min) must be less than or equal to argument #2 ($max) diff --git a/ext/standard/tests/strings/chr_error.phpt b/ext/standard/tests/strings/chr_error.phpt index efc8279f7051c..aee28604d5b88 100644 --- a/ext/standard/tests/strings/chr_error.phpt +++ b/ext/standard/tests/strings/chr_error.phpt @@ -25,7 +25,7 @@ try { *** Testing chr() : error conditions *** -- Testing chr() function with no arguments -- -chr(): Exactly 1 argument is expected, 0 given +chr() expects exactly 1 argument, 0 given -- Testing chr() function with more than expected no. of arguments -- -chr(): Exactly 1 argument is expected, 2 given +chr() expects exactly 1 argument, 2 given diff --git a/ext/standard/tests/strings/crypt.phpt b/ext/standard/tests/strings/crypt.phpt index 462aea8b59749..1d2365655533b 100644 --- a/ext/standard/tests/strings/crypt.phpt +++ b/ext/standard/tests/strings/crypt.phpt @@ -30,4 +30,4 @@ STD EXT MD5 BLO -crypt() expects exactly 2 parameters, 1 given +crypt() expects exactly 2 arguments, 1 given diff --git a/ext/standard/tests/strings/fprintf_error.phpt b/ext/standard/tests/strings/fprintf_error.phpt index efce78443f271..39bc3ebff3be4 100644 --- a/ext/standard/tests/strings/fprintf_error.phpt +++ b/ext/standard/tests/strings/fprintf_error.phpt @@ -31,7 +31,7 @@ echo "Done\n"; ?> --EXPECT-- *** Testing Error Conditions *** -fprintf(): At least 2 arguments are expected, 0 given -fprintf(): At least 2 arguments are expected, 1 given -fprintf(): At least 2 arguments are expected, 1 given +fprintf() expects at least 2 arguments, 0 given +fprintf() expects at least 2 arguments, 1 given +fprintf() expects at least 2 arguments, 1 given Done diff --git a/ext/standard/tests/strings/printf.phpt b/ext/standard/tests/strings/printf.phpt index 72c08ffe0b6de..4cd1dcfe5d231 100644 --- a/ext/standard/tests/strings/printf.phpt +++ b/ext/standard/tests/strings/printf.phpt @@ -238,10 +238,10 @@ printf("%d", $tempstring); ?> --EXPECTF-- *** Output for zero argument *** -printf(): At least %d argument is expected, %d given +printf() expects at least %d parameter, %d given *** Output for insufficient number of arguments *** -Error found: 5 parameters are required, 3 given +Error found: arguments are required, given *** Output for scalar argument *** 3 *** Output for NULL as argument *** @@ -314,14 +314,14 @@ Float Iteration 4 -1234567%d.00 Float Iteration 5 -0.00 -1.00 --1.00 -0.32 --0.32 -3.40 -2.54 --2.54 +0.00 +1.00 +-1.00 +0.32 +-0.32 +3.40 +2.54 +-2.54 1234567%d.00 -1234567%d.00 @@ -418,14 +418,14 @@ Integer Iteration 4 1234 Integer Iteration 5 -0 -1 --1 -2 --2 +0 +1 +-1 +2 +-2 23333333 -23333333 -1234 +1234 Integer Iteration 6 0000000 @@ -438,14 +438,14 @@ Integer Iteration 6 0001234 Integer Iteration 7 -0 -1 --1 -2 --2 +0 +1 +-1 +2 +-2 23333333 -23333333 -1234 +1234 Integer Iteration 8 ######0 @@ -496,7 +496,7 @@ Array C -½ +� c *** Output for scientific type *** @@ -609,17 +609,17 @@ Array Input strings variation array is: Array ( - [0] => + [0] => [1] => abc [2] => aaa ) - + abc aaa - -abc -aaa + +abc +aaa 00000 00abc 00aaa diff --git a/ext/standard/tests/strings/printf_64bit.phpt b/ext/standard/tests/strings/printf_64bit.phpt index 782ed464e2854..9404f5aad6aa8 100644 --- a/ext/standard/tests/strings/printf_64bit.phpt +++ b/ext/standard/tests/strings/printf_64bit.phpt @@ -238,7 +238,7 @@ printf("%d", $tempstring); ?> --EXPECTF-- *** Output for zero argument *** -printf(): At least 1 argument is expected, 0 given +printf() expects at least 1 argument, 0 given *** Output for insufficient number of arguments *** Error found: 5 parameters are required, 3 given diff --git a/ext/standard/tests/strings/printf_error.phpt b/ext/standard/tests/strings/printf_error.phpt index 700bbe8ac8b0d..6711b5b9adcc5 100644 --- a/ext/standard/tests/strings/printf_error.phpt +++ b/ext/standard/tests/strings/printf_error.phpt @@ -60,7 +60,7 @@ try { *** Testing printf() : error conditions *** -- Testing printf() function with Zero arguments -- -printf(): At least 1 argument is expected, 0 given +printf() expects at least 1 argument, 0 given -- Testing printf() function with less than expected no. of arguments -- diff --git a/ext/standard/tests/strings/sprintf_error.phpt b/ext/standard/tests/strings/sprintf_error.phpt index 60f91bfb6a388..836f273931397 100644 --- a/ext/standard/tests/strings/sprintf_error.phpt +++ b/ext/standard/tests/strings/sprintf_error.phpt @@ -73,7 +73,7 @@ echo "Done"; *** Testing sprintf() : error conditions *** -- Testing sprintf() function with Zero arguments -- -sprintf(): At least 1 argument is expected, 0 given +sprintf() expects at least 1 argument, 0 given -- Testing sprintf() function with less than expected no. of arguments -- 2 parameters are required, 1 given diff --git a/ext/standard/tests/strings/vfprintf_error1.phpt b/ext/standard/tests/strings/vfprintf_error1.phpt index 37fdd6b7ed774..1c114daee42d5 100644 --- a/ext/standard/tests/strings/vfprintf_error1.phpt +++ b/ext/standard/tests/strings/vfprintf_error1.phpt @@ -38,5 +38,5 @@ unlink( $file ); ?> --EXPECT-- -- Testing vfprintf() function with more than expected no. of arguments -- -vfprintf(): Exactly 3 arguments are expected, 4 given -vfprintf(): Exactly 3 arguments are expected, 4 given +vfprintf() expects exactly 3 arguments, 4 given +vfprintf() expects exactly 3 arguments, 4 given diff --git a/ext/xsl/tests/xsltprocessor_hasExsltSupport_wrongparam_001.phpt b/ext/xsl/tests/xsltprocessor_hasExsltSupport_wrongparam_001.phpt index fd8fa429fc218..b5c287f891d81 100644 --- a/ext/xsl/tests/xsltprocessor_hasExsltSupport_wrongparam_001.phpt +++ b/ext/xsl/tests/xsltprocessor_hasExsltSupport_wrongparam_001.phpt @@ -14,4 +14,4 @@ try { } ?> --EXPECT-- -XSLTProcessor::hasExsltSupport() expects exactly 0 parameters, 1 given +XSLTProcessor::hasExsltSupport() expects exactly 0 arguments, 1 given diff --git a/tests/output/ob_014.phpt b/tests/output/ob_014.phpt index c4c9c8694500e..0893db5d2518e 100644 --- a/tests/output/ob_014.phpt +++ b/tests/output/ob_014.phpt @@ -12,4 +12,4 @@ try { ?> --EXPECT-- foo -str_rot13(): Exactly 1 argument is expected, 2 given +str_rot13() expects exactly 1 argument, 2 given diff --git a/tests/output/ob_015.phpt b/tests/output/ob_015.phpt index fbd4e259a2677..47c9b24be1642 100644 --- a/tests/output/ob_015.phpt +++ b/tests/output/ob_015.phpt @@ -12,4 +12,4 @@ ob_end_flush(); ?> --EXPECT-- foo -str_rot13(): Exactly 1 argument is expected, 2 given +str_rot13() expects exactly 1 argument, 2 given From a305f0d5241c18ffcf8bd31961e6fcdc8361ca8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Tue, 8 Sep 2020 11:59:35 +0200 Subject: [PATCH 5/6] Fix tests and get rid of memory leaks --- Zend/zend_execute_API.c | 6 ++---- ext/mysqli/tests/mysqli_pconn_max_links.phpt | 2 +- .../tests/ReflectionClass_setStaticPropertyValue_002.phpt | 2 +- .../tests/ReflectionExtension_constructor_error.phpt | 6 +++--- ext/session/tests/session_set_save_handler_class_012.phpt | 2 +- ext/session/tests/session_set_save_handler_class_013.phpt | 2 +- ext/spl/tests/arrayObject_uksort_error1.phpt | 2 +- ext/sqlite3/tests/sqlite3_02_open.phpt | 2 +- 8 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 794f29a28602c..e975e67db5c22 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -511,13 +511,11 @@ ZEND_API zend_string *get_active_function_or_method_name(void) /* {{{ */ ZEND_API zend_string *get_function_or_method_name(const zend_function *func) /* {{{ */ { - const char *name = get_function_name(func); - if (func->common.scope) { - return zend_create_member_string(func->common.scope->name, zend_string_init(name, strlen(name), 1)); + return zend_create_member_string(func->common.scope->name, func->common.function_name); } - return zend_string_init(name, strlen(name), 0); + return func->common.function_name ? zend_string_copy(func->common.function_name) : zend_string_init("main", sizeof("main") - 1, 0); } /* }}} */ diff --git a/ext/mysqli/tests/mysqli_pconn_max_links.phpt b/ext/mysqli/tests/mysqli_pconn_max_links.phpt index 4e5283a19fdce..a4f7558214b13 100644 --- a/ext/mysqli/tests/mysqli_pconn_max_links.phpt +++ b/ext/mysqli/tests/mysqli_pconn_max_links.phpt @@ -261,7 +261,7 @@ array(2) { ["label"]=> string(1) "a" } -[015] Can open more persistent connections than allowed, [0] +[015] Can open more persistent connections than allowed, [0] array(3) { ["total"]=> int(3) diff --git a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt index a33f96eb72364..7bd2b1eecd9ad 100644 --- a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt +++ b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt @@ -47,6 +47,6 @@ try { ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 3 given ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 0 given ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 1 given -Class C does not have a property named +Class C does not have a property named Class C does not have a property named 1.5 ReflectionClass::setStaticPropertyValue(): Argument #1 ($name) must be of type string, array given diff --git a/ext/reflection/tests/ReflectionExtension_constructor_error.phpt b/ext/reflection/tests/ReflectionExtension_constructor_error.phpt index ccf2414e43e8e..f4241bcd9221f 100644 --- a/ext/reflection/tests/ReflectionExtension_constructor_error.phpt +++ b/ext/reflection/tests/ReflectionExtension_constructor_error.phpt @@ -25,7 +25,7 @@ try { ?> ---EXPECTF-- -Ok - ReflectionExtension::__construct() expects exactly %d parameter, %d given -Ok - ReflectionExtension::__construct() expects exactly %d parameter, %d given +--EXPECT-- +Ok - ReflectionExtension::__construct() expects exactly 1 argument, 0 given +Ok - ReflectionExtension::__construct() expects exactly 1 argument, 2 given Ok - ReflectionExtension::__construct(): Argument #1 ($name) must be of type string, array given diff --git a/ext/session/tests/session_set_save_handler_class_012.phpt b/ext/session/tests/session_set_save_handler_class_012.phpt index af52919d8bd5d..601ca32b7f9df 100644 --- a/ext/session/tests/session_set_save_handler_class_012.phpt +++ b/ext/session/tests/session_set_save_handler_class_012.phpt @@ -42,7 +42,7 @@ var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i ?> --EXPECTF-- *** Testing session_set_save_handler() : incorrect arguments for existing handler open *** -Open +Open Warning: session_start(): Failed to initialize storage module: user (path: ) in %s on line %d SessionHandler::open() expects exactly 2 arguments, 0 given diff --git a/ext/session/tests/session_set_save_handler_class_013.phpt b/ext/session/tests/session_set_save_handler_class_013.phpt index 2bd81ebc2e722..be701d3c5cb5e 100644 --- a/ext/session/tests/session_set_save_handler_class_013.phpt +++ b/ext/session/tests/session_set_save_handler_class_013.phpt @@ -38,7 +38,7 @@ var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i ?> --EXPECTF-- *** Testing session_set_save_handler() : incorrect arguments for existing handler close *** -Open +Open Read %s string(%d) "%s" string(5) "files" diff --git a/ext/spl/tests/arrayObject_uksort_error1.phpt b/ext/spl/tests/arrayObject_uksort_error1.phpt index 13fb51960541b..71164383e41bd 100644 --- a/ext/spl/tests/arrayObject_uksort_error1.phpt +++ b/ext/spl/tests/arrayObject_uksort_error1.phpt @@ -22,5 +22,5 @@ try { } ?> --EXPECT-- -ArrayObject::uksort() expects exactly 1 arguments, 0 given +ArrayObject::uksort() expects exactly 1 argument, 0 given ArrayObject::uksort() expects exactly 1 argument, 2 given diff --git a/ext/sqlite3/tests/sqlite3_02_open.phpt b/ext/sqlite3/tests/sqlite3_02_open.phpt index 7e7a73ffe00fd..db31587f68c28 100644 --- a/ext/sqlite3/tests/sqlite3_02_open.phpt +++ b/ext/sqlite3/tests/sqlite3_02_open.phpt @@ -16,4 +16,4 @@ try { ?> --EXPECT-- -string(60) "SQLite3::__construct() expects at least 1 argument, 0 given" +string(59) "SQLite3::__construct() expects at least 1 argument, 0 given" From 23f1a001e94904938d432d33a489cd9ee4dda72a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Tue, 8 Sep 2020 15:37:41 +0200 Subject: [PATCH 6/6] Another round of fixes --- ...ument_count_incorrect_internal_strict.phpt | 2 +- Zend/zend_execute.c | 13 +++++ Zend/zend_execute.h | 3 +- Zend/zend_execute_API.c | 21 +++---- Zend/zend_vm_def.h | 8 +-- Zend/zend_vm_execute.h | 8 +-- ext/opcache/jit/zend_jit_disasm_x86.c | 1 - ext/opcache/jit/zend_jit_helpers.c | 13 ----- ext/opcache/jit/zend_jit_x86.dasc | 8 +-- ext/openssl/tests/bug71475.phpt | 2 +- ext/standard/array.c | 6 +- ext/standard/formatted_print.c | 2 +- .../tests/array/array_diff_assoc_error.phpt | 4 +- .../tests/array/array_diff_error.phpt | 4 +- .../tests/array/array_diff_key_error.phpt | 4 +- ext/standard/tests/strings/printf.phpt | 56 +++++++++---------- ext/standard/tests/strings/printf_64bit.phpt | 2 +- ext/standard/tests/strings/printf_error.phpt | 12 ++-- ext/standard/tests/strings/sprintf_error.phpt | 14 ++--- 19 files changed, 79 insertions(+), 104 deletions(-) diff --git a/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt b/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt index 5bce4b19e634b..e3b5ad2deec52 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt @@ -21,4 +21,4 @@ try { ArgumentCountError substr() expects at least 2 arguments, 1 given ArgumentCountError -At least 2 parameters are required, 1 given +At least 2 arguments are required, 1 given diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 4c63db6bd2789..65a98bd5975ba 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -583,6 +583,19 @@ static zend_never_inline ZEND_COLD bool zend_wrong_assign_to_variable_reference( return 1; } +ZEND_API void zend_cannot_pass_by_reference(uint32_t arg_num) +{ + const zend_execute_data *execute_data = EG(current_execute_data); + zend_string *func_name = get_function_or_method_name(EX(call)->func); + const char *param_name = get_function_arg_name(EX(call)->func, arg_num); + + zend_throw_error(NULL, "%s(): Argument #%d%s%s%s cannot be passed by reference", + ZSTR_VAL(func_name), arg_num, param_name ? " ($" : "", param_name ? param_name : "", param_name ? ")" : "" + ); + + zend_string_release(func_name); +} + static zend_never_inline ZEND_COLD void zend_throw_auto_init_in_prop_error(zend_property_info *prop, const char *type) { zend_string *type_str = zend_type_to_string(prop->type); zend_type_error( diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index cc7f3ef19b3c7..ee8e05255be71 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -308,9 +308,7 @@ ZEND_API void ZEND_FASTCALL zend_free_extra_named_params(zend_array *extra_named /* services */ ZEND_API const char *get_active_class_name(const char **space); -ZEND_API const char *get_class_name(const zend_function *func, const char **space); ZEND_API const char *get_active_function_name(void); -ZEND_API const char *get_function_name(const zend_function *func); ZEND_API const char *get_active_function_arg_name(uint32_t arg_num); ZEND_API const char *get_function_arg_name(const zend_function *func, uint32_t arg_num); ZEND_API zend_string *get_active_function_or_method_name(); @@ -320,6 +318,7 @@ ZEND_API zend_string *zend_get_executed_filename_ex(void); ZEND_API uint32_t zend_get_executed_lineno(void); ZEND_API zend_class_entry *zend_get_executed_scope(void); ZEND_API zend_bool zend_is_executing(void); +ZEND_API void zend_cannot_pass_by_reference(uint32_t arg_num); ZEND_API void zend_set_timeout(zend_long seconds, bool reset_signals); ZEND_API void zend_unset_timeout(void); diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index e975e67db5c22..030455a94e3a1 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -433,6 +433,8 @@ void shutdown_executor(void) /* {{{ */ /* return class name and "::" or "". */ ZEND_API const char *get_active_class_name(const char **space) /* {{{ */ { + zend_function *func; + if (!zend_is_executing()) { if (space) { *space = ""; @@ -440,13 +442,8 @@ ZEND_API const char *get_active_class_name(const char **space) /* {{{ */ return ""; } - return get_class_name(EG(current_execute_data)->func, space); -} -/* }}} */ + func = EG(current_execute_data)->func; -/* return class name and "::" or "". */ -ZEND_API const char *get_class_name(const zend_function *func, const char **space) /* {{{ */ -{ switch (func->type) { case ZEND_USER_FUNCTION: case ZEND_INTERNAL_FUNCTION: @@ -469,16 +466,14 @@ ZEND_API const char *get_class_name(const zend_function *func, const char **spac ZEND_API const char *get_active_function_name(void) /* {{{ */ { + zend_function *func; + if (!zend_is_executing()) { return NULL; } - return get_function_name(EG(current_execute_data)->func); -} -/* }}} */ + func = EG(current_execute_data)->func; -ZEND_API const char *get_function_name(const zend_function *func) /* {{{ */ -{ switch (func->type) { case ZEND_USER_FUNCTION: { zend_string *function_name = func->common.function_name; @@ -501,9 +496,7 @@ ZEND_API const char *get_function_name(const zend_function *func) /* {{{ */ ZEND_API zend_string *get_active_function_or_method_name(void) /* {{{ */ { - if (!zend_is_executing()) { - return zend_string_init("", 0, 0); - } + ZEND_ASSERT(zend_is_executing()); return get_function_or_method_name(EG(current_execute_data)->func); } diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 4d49ea2cdfe22..4e9a2bd467fb3 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -4594,16 +4594,10 @@ ZEND_VM_HOT_HANDLER(65, ZEND_SEND_VAL, CONST|TMPVAR, CONST|UNUSED|NUM) ZEND_VM_COLD_HELPER(zend_cannot_pass_by_ref_helper, ANY, ANY, uint32_t _arg_num, zval *_arg) { USE_OPLINE - zend_string *func_name = get_function_or_method_name(EX(call)->func); - const char *param_name = get_function_arg_name(EX(call)->func, _arg_num); SAVE_OPLINE(); - zend_throw_error(NULL, "%s(): Argument #%d%s%s%s cannot be passed by reference", - ZSTR_VAL(func_name), _arg_num, param_name ? " ($" : "", - param_name ? param_name : "", param_name ? ")" : "" - ); - zend_string_release(func_name); + zend_cannot_pass_by_reference(_arg_num); FREE_OP1(); ZVAL_UNDEF(_arg); HANDLE_EXCEPTION(); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index c85213fb21a77..27f18240508c2 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -2281,16 +2281,10 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GENERATOR_CREATE_SPEC_HANDLER( static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_cannot_pass_by_ref_helper_SPEC(uint32_t _arg_num, zval *_arg ZEND_OPCODE_HANDLER_ARGS_DC) { USE_OPLINE - zend_string *func_name = get_function_or_method_name(EX(call)->func); - const char *param_name = get_function_arg_name(EX(call)->func, _arg_num); SAVE_OPLINE(); - zend_throw_error(NULL, "%s(): Argument #%d%s%s%s cannot be passed by reference", - ZSTR_VAL(func_name), _arg_num, param_name ? " ($" : "", - param_name ? param_name : "", param_name ? ")" : "" - ); - zend_string_release(func_name); + zend_cannot_pass_by_reference(_arg_num); FREE_OP(opline->op1_type, opline->op1.var); ZVAL_UNDEF(_arg); HANDLE_EXCEPTION(); diff --git a/ext/opcache/jit/zend_jit_disasm_x86.c b/ext/opcache/jit/zend_jit_disasm_x86.c index efd3efcf96dd2..bd737fa669732 100644 --- a/ext/opcache/jit/zend_jit_disasm_x86.c +++ b/ext/opcache/jit/zend_jit_disasm_x86.c @@ -450,7 +450,6 @@ static int zend_jit_disasm_init(void) REGISTER_HELPER(zend_jit_post_dec_typed_ref); REGISTER_HELPER(zend_jit_assign_op_to_typed_ref); REGISTER_HELPER(zend_jit_only_vars_by_reference); - REGISTER_HELPER(zend_jit_cannot_pass_by_reference); REGISTER_HELPER(zend_jit_invalid_array_access); REGISTER_HELPER(zend_jit_invalid_property_read); REGISTER_HELPER(zend_jit_invalid_property_write); diff --git a/ext/opcache/jit/zend_jit_helpers.c b/ext/opcache/jit/zend_jit_helpers.c index c5c3cba9d0070..5b6b0e4b7f6a7 100644 --- a/ext/opcache/jit/zend_jit_helpers.c +++ b/ext/opcache/jit/zend_jit_helpers.c @@ -1769,19 +1769,6 @@ static void ZEND_FASTCALL zend_jit_only_vars_by_reference(zval *arg) zend_error(E_NOTICE, "Only variables should be passed by reference"); } -static void ZEND_FASTCALL zend_jit_cannot_pass_by_reference(uint32_t arg_num) -{ - const zend_execute_data *execute_data = EG(current_execute_data); - zend_string *func_name = get_function_or_method_name(EX(call)->func); - const char *param_name = get_function_arg_name(EX(call)->func, arg_num); - - zend_throw_error(NULL, "%s(): Argument #%d%s%s%s cannot be passed by reference", - ZSTR_VAL(func_name), arg_num, param_name ? " ($" : "", param_name ? param_name : "", param_name ? ")" : "" - ); - - zend_string_release(func_name); -} - static void ZEND_FASTCALL zend_jit_invalid_array_access(zval *container) { zend_error(E_WARNING, "Trying to access array offset on value of type %s", zend_zval_type_name(container)); diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc index ab5b94821757c..cea104a8800ba 100644 --- a/ext/opcache/jit/zend_jit_x86.dasc +++ b/ext/opcache/jit/zend_jit_x86.dasc @@ -1912,12 +1912,8 @@ static int zend_jit_throw_cannot_pass_by_ref_stub(dasm_State **Dst) | mov EX->call, RX |1: | mov RX, r0 - |.if X64 - | mov CARG1d, dword OP:r0->op2.num - |.else - | mov r1, dword OP:r0->op2.num - |.endif - | EXT_CALL zend_jit_cannot_pass_by_reference, r0 + | mov FCARG1d, dword OP:r0->op2.num + | EXT_CALL zend_cannot_pass_by_reference, r0 | cmp byte OP:RX->op1_type, IS_TMP_VAR | jne >9 |.if X64 diff --git a/ext/openssl/tests/bug71475.phpt b/ext/openssl/tests/bug71475.phpt index 84f2343ba0dce..04f86d9950564 100644 --- a/ext/openssl/tests/bug71475.phpt +++ b/ext/openssl/tests/bug71475.phpt @@ -15,5 +15,5 @@ try { ?> DONE --EXPECT-- -openssl_seal() expects at least 5 parameters, 4 given +openssl_seal() expects at least 5 arguments, 4 given DONE diff --git a/ext/standard/array.c b/ext/standard/array.c index 5dff220034fc0..7779ce7806112 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -5024,7 +5024,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty argc = ZEND_NUM_ARGS(); if (data_compare_type == DIFF_COMP_DATA_USER) { if (argc < 3) { - zend_argument_count_error("At least 3 parameters are required, %d given", ZEND_NUM_ARGS()); + zend_argument_count_error("At least 3 arguments are required, %d given", ZEND_NUM_ARGS()); RETURN_THROWS(); } if (zend_parse_parameters(ZEND_NUM_ARGS(), "+f", &args, &argc, &BG(user_compare_fci), &BG(user_compare_fci_cache)) == FAILURE) { @@ -5033,7 +5033,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty diff_data_compare_func = zval_user_compare; } else { if (argc < 2) { - zend_argument_count_error("At least 2 parameters are required, %d given", ZEND_NUM_ARGS()); + zend_argument_count_error("At least 2 arguments are required, %d given", ZEND_NUM_ARGS()); RETURN_THROWS(); } if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &args, &argc) == FAILURE) { @@ -5378,7 +5378,7 @@ PHP_FUNCTION(array_diff) zval dummy; if (ZEND_NUM_ARGS() < 2) { - zend_argument_count_error("At least 2 parameters are required, %d given", ZEND_NUM_ARGS()); + zend_argument_count_error("At least 2 arguments are required, %d given", ZEND_NUM_ARGS()); RETURN_THROWS(); } diff --git a/ext/standard/formatted_print.c b/ext/standard/formatted_print.c index 12d3d3df7decc..9bb4a5cb0652a 100644 --- a/ext/standard/formatted_print.c +++ b/ext/standard/formatted_print.c @@ -719,7 +719,7 @@ php_formatted_print(char *format, size_t format_len, zval *args, int argc, int n if (nb_additional_parameters == -1) { zend_value_error("The arguments array must contain %d items, %d given", max_missing_argnum + 1, argc); } else { - zend_argument_count_error("%d parameters are required, %d given", max_missing_argnum + nb_additional_parameters + 1, argc + nb_additional_parameters); + zend_argument_count_error("%d arguments are required, %d given", max_missing_argnum + nb_additional_parameters + 1, argc + nb_additional_parameters); } goto fail; } diff --git a/ext/standard/tests/array/array_diff_assoc_error.phpt b/ext/standard/tests/array/array_diff_assoc_error.phpt index 02ee5f282bc08..bc2a1e7936cfa 100644 --- a/ext/standard/tests/array/array_diff_assoc_error.phpt +++ b/ext/standard/tests/array/array_diff_assoc_error.phpt @@ -31,8 +31,8 @@ echo "Done"; *** Testing array_diff_assoc() : error conditions *** -- Testing array_diff_assoc() function with zero arguments -- -At least 2 parameters are required, 0 given +At least 2 arguments are required, 0 given -- Testing array_diff_assoc() function with less than expected no. of arguments -- -At least 2 parameters are required, 1 given +At least 2 arguments are required, 1 given Done diff --git a/ext/standard/tests/array/array_diff_error.phpt b/ext/standard/tests/array/array_diff_error.phpt index 81481fd207d81..37a0681703689 100644 --- a/ext/standard/tests/array/array_diff_error.phpt +++ b/ext/standard/tests/array/array_diff_error.phpt @@ -31,8 +31,8 @@ echo "Done"; *** Testing array_diff() : error conditions *** -- Testing array_diff() function with zero arguments -- -At least 2 parameters are required, 0 given +At least 2 arguments are required, 0 given -- Testing array_diff() function with less than expected no. of arguments -- -At least 2 parameters are required, 1 given +At least 2 arguments are required, 1 given Done diff --git a/ext/standard/tests/array/array_diff_key_error.phpt b/ext/standard/tests/array/array_diff_key_error.phpt index a468b832b6870..1ac25ea67cc36 100644 --- a/ext/standard/tests/array/array_diff_key_error.phpt +++ b/ext/standard/tests/array/array_diff_key_error.phpt @@ -27,7 +27,7 @@ try { *** Testing array_diff_key() : error conditions *** -- Testing array_diff_key() function with less than expected no. of arguments -- -At least 2 parameters are required, 1 given +At least 2 arguments are required, 1 given -- Testing array_diff_key() function with no arguments -- -At least 2 parameters are required, 0 given +At least 2 arguments are required, 0 given diff --git a/ext/standard/tests/strings/printf.phpt b/ext/standard/tests/strings/printf.phpt index 4cd1dcfe5d231..db47f58c53ba3 100644 --- a/ext/standard/tests/strings/printf.phpt +++ b/ext/standard/tests/strings/printf.phpt @@ -238,10 +238,10 @@ printf("%d", $tempstring); ?> --EXPECTF-- *** Output for zero argument *** -printf() expects at least %d parameter, %d given +printf() expects at least %d argument, %d given *** Output for insufficient number of arguments *** -Error found: arguments are required, given +Error found: 5 arguments are required, 3 given *** Output for scalar argument *** 3 *** Output for NULL as argument *** @@ -314,14 +314,14 @@ Float Iteration 4 -1234567%d.00 Float Iteration 5 -0.00 -1.00 --1.00 -0.32 --0.32 -3.40 -2.54 --2.54 +0.00 +1.00 +-1.00 +0.32 +-0.32 +3.40 +2.54 +-2.54 1234567%d.00 -1234567%d.00 @@ -418,14 +418,14 @@ Integer Iteration 4 1234 Integer Iteration 5 -0 -1 --1 -2 --2 +0 +1 +-1 +2 +-2 23333333 -23333333 -1234 +1234 Integer Iteration 6 0000000 @@ -438,14 +438,14 @@ Integer Iteration 6 0001234 Integer Iteration 7 -0 -1 --1 -2 --2 +0 +1 +-1 +2 +-2 23333333 -23333333 -1234 +1234 Integer Iteration 8 ######0 @@ -496,7 +496,7 @@ Array C -� +½ c *** Output for scientific type *** @@ -609,17 +609,17 @@ Array Input strings variation array is: Array ( - [0] => + [0] => [1] => abc [2] => aaa ) - + abc aaa - -abc -aaa + +abc +aaa 00000 00abc 00aaa diff --git a/ext/standard/tests/strings/printf_64bit.phpt b/ext/standard/tests/strings/printf_64bit.phpt index 9404f5aad6aa8..2886799cc7ede 100644 --- a/ext/standard/tests/strings/printf_64bit.phpt +++ b/ext/standard/tests/strings/printf_64bit.phpt @@ -241,7 +241,7 @@ printf("%d", $tempstring); printf() expects at least 1 argument, 0 given *** Output for insufficient number of arguments *** -Error found: 5 parameters are required, 3 given +Error found: 5 arguments are required, 3 given *** Output for scalar argument *** 3 *** Output for NULL as argument *** diff --git a/ext/standard/tests/strings/printf_error.phpt b/ext/standard/tests/strings/printf_error.phpt index 6711b5b9adcc5..2842f5cea1243 100644 --- a/ext/standard/tests/strings/printf_error.phpt +++ b/ext/standard/tests/strings/printf_error.phpt @@ -65,13 +65,13 @@ printf() expects at least 1 argument, 0 given -- Testing printf() function with less than expected no. of arguments -- -- Call printf with one argument less than expected -- -2 parameters are required, 1 given -3 parameters are required, 2 given -4 parameters are required, 3 given +2 arguments are required, 1 given +3 arguments are required, 2 given +4 arguments are required, 3 given -- Call printf with two argument less than expected -- -3 parameters are required, 1 given -4 parameters are required, 2 given +3 arguments are required, 1 given +4 arguments are required, 2 given -- Call printf with three argument less than expected -- -4 parameters are required, 1 given +4 arguments are required, 1 given diff --git a/ext/standard/tests/strings/sprintf_error.phpt b/ext/standard/tests/strings/sprintf_error.phpt index 836f273931397..bab3fabae31c1 100644 --- a/ext/standard/tests/strings/sprintf_error.phpt +++ b/ext/standard/tests/strings/sprintf_error.phpt @@ -76,12 +76,12 @@ echo "Done"; sprintf() expects at least 1 argument, 0 given -- Testing sprintf() function with less than expected no. of arguments -- -2 parameters are required, 1 given -3 parameters are required, 2 given -4 parameters are required, 3 given -3 parameters are required, 1 given -4 parameters are required, 2 given -4 parameters are required, 1 given -101 parameters are required, 1 given +2 arguments are required, 1 given +3 arguments are required, 2 given +4 arguments are required, 3 given +3 arguments are required, 1 given +4 arguments are required, 2 given +4 arguments are required, 1 given +101 arguments are required, 1 given Missing format specifier at end of string Done