From b1ce1d1f21b9e5395ce8d0c7f8b8d8200b837ced Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Thu, 24 Aug 2023 21:05:26 +0100 Subject: [PATCH] Fix param name in implode() error message --- ext/standard/string.c | 2 +- ext/standard/tests/strings/implode1.phpt | 6 +++--- ext/standard/tests/strings/join_error.phpt | 2 +- ext/standard/tests/strings/join_variation2.phpt | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ext/standard/string.c b/ext/standard/string.c index 623ce7d365b..da1a97f49da 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1238,7 +1238,7 @@ PHP_FUNCTION(implode) if (pieces == NULL) { if (arg1_array == NULL) { - zend_type_error("%s(): Argument #1 ($pieces) must be of type array, string given", get_active_function_name()); + zend_type_error("%s(): Argument #1 ($array) must be of type array, string given", get_active_function_name()); RETURN_THROWS(); } diff --git a/ext/standard/tests/strings/implode1.phpt b/ext/standard/tests/strings/implode1.phpt index 7092efe9424..d467a37dd31 100644 --- a/ext/standard/tests/strings/implode1.phpt +++ b/ext/standard/tests/strings/implode1.phpt @@ -236,7 +236,7 @@ string(35) "2000-639010PHP000 0string%0with%0...%0" string(43) "2\00\0-639\01\0PHP\0\0\0 \0string%0with%0...%0" *** Testing implode() on empty string *** -implode(): Argument #1 ($pieces) must be of type array, string given +implode(): Argument #1 ($array) must be of type array, string given *** Testing implode() on sub-arrays *** @@ -266,9 +266,9 @@ array(2) { string(%d) "Resource id #%d::Resource id #%d" *** Testing error conditions *** -implode(): Argument #1 ($pieces) must be of type array, string given +implode(): Argument #1 ($array) must be of type array, string given implode(): Argument #2 ($array) must be of type ?array, int given -implode(): Argument #1 ($pieces) must be of type array, string given +implode(): Argument #1 ($array) must be of type array, string given string(0) "" implode(): Argument #2 ($array) must be of type ?array, string given diff --git a/ext/standard/tests/strings/join_error.phpt b/ext/standard/tests/strings/join_error.phpt index f52c4c1184d..c3cee28812d 100644 --- a/ext/standard/tests/strings/join_error.phpt +++ b/ext/standard/tests/strings/join_error.phpt @@ -20,5 +20,5 @@ echo "Done\n"; *** Testing join() : error conditions *** -- Testing join() with less than expected no. of arguments -- -join(): Argument #1 ($pieces) must be of type array, string given +join(): Argument #1 ($array) must be of type array, string given Done diff --git a/ext/standard/tests/strings/join_variation2.phpt b/ext/standard/tests/strings/join_variation2.phpt index 57f570b2587..3991e0c52a6 100644 --- a/ext/standard/tests/strings/join_variation2.phpt +++ b/ext/standard/tests/strings/join_variation2.phpt @@ -138,13 +138,13 @@ join(): Argument #2 ($array) must be of type ?array, string given -- Iteration 18 -- join(): Argument #2 ($array) must be of type ?array, string given -- Iteration 19 -- -join(): Argument #1 ($pieces) must be of type array, string given +join(): Argument #1 ($array) must be of type array, string given -- Iteration 20 -- -join(): Argument #1 ($pieces) must be of type array, string given +join(): Argument #1 ($array) must be of type array, string given -- Iteration 21 -- join(): Argument #2 ($array) must be of type ?array, resource given -- Iteration 22 -- -join(): Argument #1 ($pieces) must be of type array, string given +join(): Argument #1 ($array) must be of type array, string given -- Iteration 23 -- -join(): Argument #1 ($pieces) must be of type array, string given +join(): Argument #1 ($array) must be of type array, string given Done