diff --git a/tests/PHPStan/Rules/Comparison/data/strict-comparison.php b/tests/PHPStan/Rules/Comparison/data/strict-comparison.php index 53c9a5ceb3..368aab3305 100644 --- a/tests/PHPStan/Rules/Comparison/data/strict-comparison.php +++ b/tests/PHPStan/Rules/Comparison/data/strict-comparison.php @@ -935,3 +935,17 @@ private function returnsVoid(): void } } + +abstract class RandomAbstractClass {} + +class AvoidRegressionBecauseThisWasReturningAnErrorInPhpstan11_5 +{ + private const MAPPING = [\stdClass::class, RandomAbstractClass::class]; + + public function test(int $key) + { + if (is_subclass_of(self::MAPPING[$key], RandomAbstractClass::class) === false) { + return; + } + } +}