From 7aa58767eac051383e85e866a220e2bd296c095c Mon Sep 17 00:00:00 2001 From: HawkForge <75696486+HawkForge@users.noreply.github.com> Date: Thu, 15 Oct 2026 16:47:14 +0600 Subject: [PATCH] Add regression test for #12882 Closes https://github.com/phpstan/phpstan/issues/12882 --- tests/PHPStan/Rules/Comparison/data/bug-12241.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/PHPStan/Rules/Comparison/data/bug-12241.php b/tests/PHPStan/Rules/Comparison/data/bug-12241.php index 7d8edd3f131..82bc6e8ba17 100644 --- a/tests/PHPStan/Rules/Comparison/data/bug-12241.php +++ b/tests/PHPStan/Rules/Comparison/data/bug-12241.php @@ -18,3 +18,10 @@ function (Foo $foo): string { Baz::class => 'Baz', }; }; + +function (Foo $foo): string { + return match (get_class($foo)) { + Bar::class => 'Bar', + Baz::class => 'Baz', + }; +};