You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
False positive method.notFound when using @phpstan-assert-if-true static<A> $this #12820
@@ @@-PHP 8.0 – 8.4 (1 error)+PHP 8.0 – 8.4
==========
-29: Call to an undefined method (T of A = A|B)|T of B = A|B::a().+No errors-PHP 7.2 – 7.4 (3 errors)+PHP 7.2 – 7.4 (2 errors)
==========
4: Constructor of class A has a return type.
-17: Method FooInterface::get() uses native union types but they're supported only on PHP 8.0 and later.-29: Call to an undefined method (T of A = A|B)|T of B = A|B::a().+17: Method FooInterface::get() uses native union types but they're supported only on PHP 8.0 and later.
Full report
PHP 8.0 – 8.4
No errors
PHP 7.2 – 7.4 (2 errors)
Line
Error
4
Constructor of class A has a return type.
17
Method FooInterface::get() uses native union types but they're supported only on PHP 8.0 and later.
Activity
phpstan-bot commentedon Oct 24, 2026
@gharlan After the latest push in 2.3.x, PHPStan now reports different result with your code snippet:
Full report
PHP 8.0 – 8.4
No errors
PHP 7.2 – 7.4 (2 errors)
Constructor of class A has a return type.Method FooInterface::get() uses native union types but they're supported only on PHP 8.0 and later.staabm commentedon Oct 25, 2026
Needs a regression test
Updated PHPStan to commit 74c549b44e43920f44fb04e998459550ce237d0c