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 about overwritten throw/return when a finally conditionally exits #7665
@@ @@
7: Method HelloWorld::doStuff() should return string but return statement is missing.
9: This throw is overwritten by a different one in the finally block below.
13: This return is overwritten by a different one in the finally block below.
+17: Expression "exit(1)" on a separate line does not do anything.
17: This exit point is overwritten by a different one in the finally block below.
+22: Expression "exit(1)" on a separate line does not do anything.
22: The overwriting exit point is on this line.
Full report
Line
Error
7
Method HelloWorld::doStuff() should return string but return statement is missing.
9
This throw is overwritten by a different one in the finally block below.
13
This return is overwritten by a different one in the finally block below.
17
Expression "exit(1)" on a separate line does not do anything.
17
This exit point is overwritten by a different one in the finally block below.
22
Expression "exit(1)" on a separate line does not do anything.
Activity
phpstan-bot commentedon Apr 3, 2024
@Seldaek After the latest push in 1.11.x, PHPStan now reports different result with your code snippet:
Full report
Method HelloWorld::doStuff() should return string but return statement is missing.This throw is overwritten by a different one in the finally block below.This return is overwritten by a different one in the finally block below.Expression "exit(1)" on a separate line does not do anything.This exit point is overwritten by a different one in the finally block below.Expression "exit(1)" on a separate line does not do anything.The overwriting exit point is on this line.Add regression tests for issues also fixed by the finally exit point …
phpstan-bot commentedon Mar 13, 2026
Closed via merging phpstan/phpstan-src#5163
github-actions commentedon Apr 14, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.