Skip to content

Commit 518f773

Browse files
committed
Clarify sscanf %c whitespace note
1 parent 08ea8fb commit 518f773

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

UPGRADING

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ PHP 8.6 UPGRADE NOTES
102102
- Standard:
103103
. Form feed (\f) is now added in the default trimmed characters of trim(),
104104
rtrim() and ltrim(). RFC: https://wiki.php.net/rfc/trim_form_feed
105-
. sscanf() and fscanf() now make the %c conversion consume whitespace.
106-
Previously, the conversion stopped at whitespace even though %c does not
107-
skip leading whitespace.
105+
. sscanf() and fscanf() %c conversions no longer stop at whitespace. They
106+
still do not skip leading whitespace; whitespace is now consumed and
107+
assigned as part of the result.
108108
. array_filter() now raises a ValueError when an invalid $mode
109109
argument value is passed.
110110
. array_change_key_case() now raises a ValueError when an invalid $case

ext/standard/scanf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ PHPAPI int php_sscanf_internal( char *string, char *format,
833833
end = string;
834834
while (*end != '\0') {
835835
sch = *end;
836-
if (op == 's' && isspace((unsigned char) sch)) {
836+
if (op == 's' && isspace( (unsigned char)sch ) ) {
837837
break;
838838
}
839839
end++;

0 commit comments

Comments
 (0)