Skip to content

Commit 5528df1

Browse files
authored
Fix TypeError message of setlocale() (#20625)
1 parent d9032b3 commit 5528df1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ext/standard/string.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4957,7 +4957,7 @@ PHP_FUNCTION(setlocale)
49574957

49584958
for (uint32_t i = 0; i < num_args; i++) {
49594959
if (UNEXPECTED(Z_TYPE(args[i]) != IS_ARRAY && !zend_parse_arg_str(&args[i], &strings[i], true, i + 2))) {
4960-
zend_wrong_parameter_type_error(i + 2, Z_EXPECTED_ARRAY_OR_STRING, &args[i]);
4960+
zend_wrong_parameter_type_error(i + 2, Z_EXPECTED_ARRAY_OR_STRING_OR_NULL, &args[i]);
49614961
goto out;
49624962
}
49634963
}

ext/standard/tests/strings/gh18823_strict.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ try {
1515
}
1616
?>
1717
--EXPECT--
18-
setlocale(): Argument #2 ($locales) must be of type array|string, int given
19-
setlocale(): Argument #3 must be of type array|string, int given
18+
setlocale(): Argument #2 ($locales) must be of type array|string|null, int given
19+
setlocale(): Argument #3 must be of type array|string|null, int given

0 commit comments

Comments
 (0)