-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(s)printf fatal error not reported when params don't match placeholders #9817
Labels
Comments
I found these snippets: https://psalm.dev/r/4be0b0cec6<?php
printf( '%d' );
|
kkmuffme
added a commit
to kkmuffme/psalm
that referenced
this issue
May 30, 2023
Fix vimeo#9819 This PR is a starting point for improving the sprintf return type and eventually validate the format, param types and param count. (see vimeo#9817, vimeo#9818)
kkmuffme
added a commit
to kkmuffme/psalm
that referenced
this issue
May 30, 2023
Fix vimeo#9819 This PR is a starting point for improving the sprintf return type and eventually validate the format, param types and param count. (see vimeo#9817, vimeo#9818)
kkmuffme
added a commit
to kkmuffme/psalm
that referenced
this issue
May 30, 2023
Fix vimeo#9819 This PR is a starting point for improving the sprintf return type and eventually validate the format, param types and param count. (see vimeo#9817, vimeo#9818)
kkmuffme
added a commit
to kkmuffme/psalm
that referenced
this issue
Jun 6, 2023
* check args for (s)printf for Invalid/TooMany/TooFew * don't change the return type when we cannot infer it more specifically (nullable return) * fix vimeo#9874 * implement vimeo#9817 * add tests
kkmuffme
added a commit
to kkmuffme/psalm
that referenced
this issue
Jun 7, 2023
* check args for (s)printf for Invalid/TooMany/TooFew * don't change the return type when we cannot infer it more specifically (nullable return) * fix vimeo#9874 * implement vimeo#9817 * add tests
kkmuffme
added a commit
to kkmuffme/psalm
that referenced
this issue
Jun 9, 2023
* check args for (s)printf for Invalid/TooMany/TooFew * don't change the return type when we cannot infer it more specifically (nullable return) * fix vimeo#9874 * implement vimeo#9817 * add tests
Fixed in #9841 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When the first param of (s)printf is a literal string (otherwise not possible to validate in psalm):
https://psalm.dev/r/4be0b0cec6
The number of params - 1 must match the number of unique placeholders. Atm this reports as "no errors" while in reality this is a fatal error (ArgumentCountError)
The text was updated successfully, but these errors were encountered: