Skip to content

Counting sscanf/fscanf format string placeholders#5594

Open
hakre wants to merge 4 commits intophpstan:2.1.xfrom
hakre:patch-1
Open

Counting sscanf/fscanf format string placeholders#5594
hakre wants to merge 4 commits intophpstan:2.1.xfrom
hakre:patch-1

Conversation

@hakre
Copy link
Copy Markdown

@hakre hakre commented May 3, 2026

Update PrintfHelper.php:

Make public function getScanfPlaceholdersCount(string $format): ?int returning the sscanf() vetted number of placeholders that give/return/assign conversions.

refs:

@hakre hakre force-pushed the patch-1 branch 2 times, most recently from ae5ea92 to dbe616b Compare May 3, 2026 18:24
hakre added 2 commits May 3, 2026 20:44
Make `public function getScanfPlaceholdersCount(string $format): ?int` returning the sscanf() vetted number of placeholders that give/return/assign conversions.

refs:

- phpstan#5591
- phpstan/phpstan#14567
…t string at NUL byte before counting placeholders

 phpstan#5591
@phpstan-bot: perhaps you can spend some LLM-inference on the two comments, the earlier for feasibility, the later with your bets when this could happen.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant