Skip to content

Commit 72c6102

Browse files
Fixes #12682
1 parent d882c5d commit 72c6102

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

ext/standard/string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ PHP_FUNCTION(implode)
10351035

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
--TEST--
2+
join() function - error when passing null as the array parameter
3+
--FILE--
4+
<?php
5+
try {
6+
join('', null);
7+
} catch (TypeError $e) {
8+
echo $e->getMessage();
9+
}
10+
?>
11+
--EXPECT--
12+
join(): Argument #2 ($array) must be of type array, null given

0 commit comments

Comments
 (0)