Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ PHP NEWS
- Standard:
. Fixed bug GH-19926 (reset internal pointer earlier while splicing array
while COW violation flag is still set). (alexandre-daubois)
. strcoll() now throws a ValueError when passed a string containing NUL bytes
instead of silently cutting off the string after the first NUL byte.
(ndossche)

- Streams:
. Added so_reuseaddr streams context socket option that allows disabling
Expand Down
4 changes: 4 additions & 0 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ PHP 8.6 UPGRADE NOTES
. Invalid values now throw in Phar::mungServer() instead of being silently
ignored.

- Standard:
. strcoll() now throws a ValueError when passed a string containing NUL bytes
instead of silently cutting off the string after the first NUL byte.

========================================
2. New Features
========================================
Expand Down
4 changes: 2 additions & 2 deletions ext/standard/string.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,8 @@ PHP_FUNCTION(strcoll)
zend_string *s1, *s2;

ZEND_PARSE_PARAMETERS_START(2, 2)
Z_PARAM_STR(s1)
Z_PARAM_STR(s2)
Z_PARAM_PATH_STR(s1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we probably need 2 test cases at least.

Z_PARAM_PATH_STR(s2)
ZEND_PARSE_PARAMETERS_END();

RETURN_LONG(strcoll((const char *) ZSTR_VAL(s1),
Expand Down