diff --git a/tests/PHPStan/Rules/Functions/ExistingClassesInArrowFunctionTypehintsRuleTest.php b/tests/PHPStan/Rules/Functions/ExistingClassesInArrowFunctionTypehintsRuleTest.php index b7d14e5ee6..b54bf39163 100644 --- a/tests/PHPStan/Rules/Functions/ExistingClassesInArrowFunctionTypehintsRuleTest.php +++ b/tests/PHPStan/Rules/Functions/ExistingClassesInArrowFunctionTypehintsRuleTest.php @@ -311,4 +311,17 @@ public function testNever(): void $this->analyse([__DIR__ . '/data/arrow-function-never.php'], $errors); } + public function testBug5206(): void + { + $errors = []; + if (PHP_VERSION_ID < 80000) { + $errors[] = [ + 'Parameter $mixed of anonymous function has invalid type Bug5206\mixed.', + 9, + ]; + } + + $this->analyse([__DIR__ . '/data/bug-5206.php'], $errors); + } + } diff --git a/tests/PHPStan/Rules/Functions/data/bug-5206.php b/tests/PHPStan/Rules/Functions/data/bug-5206.php new file mode 100644 index 0000000000..58738ac19a --- /dev/null +++ b/tests/PHPStan/Rules/Functions/data/bug-5206.php @@ -0,0 +1,11 @@ + '`mixed` type!'; + } +}