You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per the php doc regarding the precision in printf-like functions:
Note: If the period is specified without an explicit value for precision, 0 is assumed. If * is used, the precision is supplied as an additional integer value preceding the one formatted by the specifier.
If a * is used as the precision of a float number, phpstan complains about Call to printf contains 0 placeholders, 3 values given..
printf("%*.*f", 6, 2, 1);
PR #2543 fixed the variable width but issue #9674 failed to mention the variable precision.
Bug report
This issue follows #9674.
As per the php doc regarding the precision in printf-like functions:
If a
*
is used as the precision of a float number, phpstan complains aboutCall to printf contains 0 placeholders, 3 values given.
.PR #2543 fixed the variable width but issue #9674 failed to mention the variable precision.
Code snippet that reproduces the problem
https://phpstan.org/r/067797e9-18f6-4e48-874d-11f496dd6a1f
Expected output
Phpstan should detect the variable precision and accept one argument in addition to the width and the value to format.
Note that the width may be an actual digit:
Did PHPStan help you today? Did it make you happy in any way?
No response
The text was updated successfully, but these errors were encountered: