Skip to content

Commit abc6c9b

Browse files
committed
Fix implode() function signature
1 parent e1cb721 commit abc6c9b

File tree

6 files changed

+36
-36
lines changed

6 files changed

+36
-36
lines changed

ext/standard/basic_functions.stub.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2331,10 +2331,10 @@ function explode(string $separator, string $string, int $limit = PHP_INT_MAX): a
23312331
/**
23322332
* @compile-time-eval
23332333
*/
2334-
function implode(string|array $separator, ?array $array = null): string {}
2334+
function implode(string|array $separator, array $array = []): string {}
23352335

23362336
/** @alias implode */
2337-
function join(string|array $separator, ?array $array = null): string {}
2337+
function join(string|array $separator, array $array = []): string {}
23382338

23392339
/**
23402340
* @compile-time-eval

ext/standard/basic_functions_arginfo.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/standard/string.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,12 +1030,12 @@ PHP_FUNCTION(implode)
10301030
ZEND_PARSE_PARAMETERS_START(1, 2)
10311031
Z_PARAM_ARRAY_HT_OR_STR(arg1_array, arg1_str)
10321032
Z_PARAM_OPTIONAL
1033-
Z_PARAM_ARRAY_HT_OR_NULL(pieces)
1033+
Z_PARAM_ARRAY_HT(pieces)
10341034
ZEND_PARSE_PARAMETERS_END();
10351035

10361036
if (pieces == NULL) {
10371037
if (arg1_array == NULL) {
1038-
zend_type_error("%s(): Argument #1 ($pieces) must be of type array, string given", get_active_function_name());
1038+
zend_type_error("%s(): Argument #1 ($array) must be of type array, string given", get_active_function_name());
10391039
RETURN_THROWS();
10401040
}
10411041

ext/standard/tests/strings/implode1.phpt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ string(35) "2000-639010PHP000 0string%0with%0...%0"
236236
string(43) "2\00\0-639\01\0PHP\0\0\0 \0string%0with%0...%0"
237237

238238
*** Testing implode() on empty string ***
239-
implode(): Argument #1 ($pieces) must be of type array, string given
239+
implode(): Argument #1 ($array) must be of type array, string given
240240

241241
*** Testing implode() on sub-arrays ***
242242

@@ -266,12 +266,12 @@ array(2) {
266266
string(%d) "Resource id #%d::Resource id #%d"
267267

268268
*** Testing error conditions ***
269-
implode(): Argument #1 ($pieces) must be of type array, string given
270-
implode(): Argument #2 ($array) must be of type ?array, int given
271-
implode(): Argument #1 ($pieces) must be of type array, string given
269+
implode(): Argument #1 ($array) must be of type array, string given
270+
implode(): Argument #2 ($array) must be of type array, int given
271+
implode(): Argument #2 ($array) must be of type array, null given
272272
string(0) ""
273-
implode(): Argument #2 ($array) must be of type ?array, string given
273+
implode(): Argument #2 ($array) must be of type array, string given
274274

275275
Deprecated: implode(): Passing null to parameter #1 ($separator) of type array|string is deprecated in %s on line %d
276-
implode(): Argument #2 ($array) must be of type ?array, string given
276+
implode(): Argument #2 ($array) must be of type array, string given
277277
Done

ext/standard/tests/strings/join_error.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ echo "Done\n";
2020
*** Testing join() : error conditions ***
2121

2222
-- Testing join() with less than expected no. of arguments --
23-
join(): Argument #1 ($pieces) must be of type array, string given
23+
join(): Argument #1 ($array) must be of type array, string given
2424
Done

ext/standard/tests/strings/join_variation2.phpt

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -102,49 +102,49 @@ echo "Done\n";
102102

103103
--- Testing join() by supplying different values for 'pieces' argument ---
104104
-- Iteration 1 --
105-
join(): Argument #2 ($array) must be of type ?array, int given
105+
join(): Argument #2 ($array) must be of type array, int given
106106
-- Iteration 2 --
107-
join(): Argument #2 ($array) must be of type ?array, int given
107+
join(): Argument #2 ($array) must be of type array, int given
108108
-- Iteration 3 --
109-
join(): Argument #2 ($array) must be of type ?array, int given
109+
join(): Argument #2 ($array) must be of type array, int given
110110
-- Iteration 4 --
111-
join(): Argument #2 ($array) must be of type ?array, int given
111+
join(): Argument #2 ($array) must be of type array, int given
112112
-- Iteration 5 --
113-
join(): Argument #2 ($array) must be of type ?array, float given
113+
join(): Argument #2 ($array) must be of type array, float given
114114
-- Iteration 6 --
115-
join(): Argument #2 ($array) must be of type ?array, float given
115+
join(): Argument #2 ($array) must be of type array, float given
116116
-- Iteration 7 --
117-
join(): Argument #2 ($array) must be of type ?array, float given
117+
join(): Argument #2 ($array) must be of type array, float given
118118
-- Iteration 8 --
119-
join(): Argument #2 ($array) must be of type ?array, float given
119+
join(): Argument #2 ($array) must be of type array, float given
120120
-- Iteration 9 --
121-
join(): Argument #2 ($array) must be of type ?array, float given
121+
join(): Argument #2 ($array) must be of type array, float given
122122
-- Iteration 10 --
123-
join(): Argument #2 ($array) must be of type ?array, true given
123+
join(): Argument #2 ($array) must be of type array, true given
124124
-- Iteration 11 --
125-
join(): Argument #2 ($array) must be of type ?array, false given
125+
join(): Argument #2 ($array) must be of type array, false given
126126
-- Iteration 12 --
127-
join(): Argument #2 ($array) must be of type ?array, true given
127+
join(): Argument #2 ($array) must be of type array, true given
128128
-- Iteration 13 --
129-
join(): Argument #2 ($array) must be of type ?array, false given
129+
join(): Argument #2 ($array) must be of type array, false given
130130
-- Iteration 14 --
131-
join(): Argument #2 ($array) must be of type ?array, string given
131+
join(): Argument #2 ($array) must be of type array, string given
132132
-- Iteration 15 --
133-
join(): Argument #2 ($array) must be of type ?array, string given
133+
join(): Argument #2 ($array) must be of type array, string given
134134
-- Iteration 16 --
135-
join(): Argument #2 ($array) must be of type ?array, test given
135+
join(): Argument #2 ($array) must be of type array, test given
136136
-- Iteration 17 --
137-
join(): Argument #2 ($array) must be of type ?array, string given
137+
join(): Argument #2 ($array) must be of type array, string given
138138
-- Iteration 18 --
139-
join(): Argument #2 ($array) must be of type ?array, string given
139+
join(): Argument #2 ($array) must be of type array, string given
140140
-- Iteration 19 --
141-
join(): Argument #1 ($pieces) must be of type array, string given
141+
join(): Argument #2 ($array) must be of type array, null given
142142
-- Iteration 20 --
143-
join(): Argument #1 ($pieces) must be of type array, string given
143+
join(): Argument #2 ($array) must be of type array, null given
144144
-- Iteration 21 --
145-
join(): Argument #2 ($array) must be of type ?array, resource given
145+
join(): Argument #2 ($array) must be of type array, resource given
146146
-- Iteration 22 --
147-
join(): Argument #1 ($pieces) must be of type array, string given
147+
join(): Argument #2 ($array) must be of type array, null given
148148
-- Iteration 23 --
149-
join(): Argument #1 ($pieces) must be of type array, string given
149+
join(): Argument #2 ($array) must be of type array, null given
150150
Done

0 commit comments

Comments
 (0)