diff --git a/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php b/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php index a6513f03cb1..e76e464513d 100644 --- a/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php +++ b/tests/PHPStan/Rules/Functions/CallToFunctionParametersRuleTest.php @@ -545,6 +545,20 @@ public function testBugNumberFormatNamedArguments(): void $this->analyse([__DIR__ . '/data/number-format-named-arguments.php'], []); } + public function testBug14408(): void + { + if (PHP_VERSION_ID < 80000) { + $this->markTestSkipped('Test requires PHP 8.0'); + } + + $this->analyse([__DIR__ . '/data/bug-14408.php'], [ + [ + 'Unknown parameter $foo in call to function sprintf.', + 6, + ], + ]); + } + public function testArrayReduceCallback(): void { $this->analyse([__DIR__ . '/data/array_reduce.php'], [ diff --git a/tests/PHPStan/Rules/Functions/data/bug-14408.php b/tests/PHPStan/Rules/Functions/data/bug-14408.php new file mode 100644 index 00000000000..725821c9dc2 --- /dev/null +++ b/tests/PHPStan/Rules/Functions/data/bug-14408.php @@ -0,0 +1,12 @@ +