vscode-intelephense
vscode-intelephense copied to clipboard
Diagnostic that detects incorrect `sprintf` use
Feature description or problem with existing feature
I'd like to see a diagnostic error if I call sprintf()
with an inappropriate number of arguments.
Describe the solution you'd like
When my sprintf()
format string contains 2 placeholders, but I only pass 1 value, then PHP will throw an ArgumentCountError
. I'd like Intelephense to report this error for me.
Additional context
<?php
printf(
'%s %s', // two placeholders
'foo' // only one parameter
);
/*
Fatal error: Uncaught ArgumentCountError: 3 arguments are required, 2 given in test.php on line 5
*/