Skip to content

Commit 1fb4e57

Browse files
Merge branch 'PHP-8.5'
* PHP-8.5: Fix TypeError message of `setlocale()` (#20625)
2 parents 824c389 + 5528df1 commit 1fb4e57

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
@@ -4955,7 +4955,7 @@ PHP_FUNCTION(setlocale)
49554955

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

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)