[Discussion] sscanf/fscanf %c whitespace handling in master, GH-19088
| From: | Pratik Bhujel | Date: | Thu, 02 Jul 2026 16:49:03 +0000 |
| Subject: | [Discussion] sscanf/fscanf %c whitespace handling in master, GH-19088 | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-131715@lists.php.net to get a copy of this message | ||
Hi internals, I opened a PR for GH-19088 to fix
%c handling in sscanf()
/ fscanf():
https://github.com/php/php-src/pull/22041
The issue is that %c already does not skip leading whitespace, but after
that it still shared the %s scan path and stopped at whitespace. The PR
keeps %c separate so it consumes the requested characters, including
whitespace.
There was some concern on the PR that this behavior has existed since PHP
4.3.2, so even if this is a bug fix it may still have BC impact for code
relying on the old behavior. The PR is targeting master only and has an
UPGRADING note.
Before this gets merged, does anyone see this as problematic for master?
Thanks,
Pratik