-
-
Notifications
You must be signed in to change notification settings - Fork 863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
false positive: Variable $var might not be defined when using switch in catch block #1219
Comments
Hi, |
Or return that value in try block https://phpstan.org/r/a8c5d87ad1e198548331e704920c651d |
Again, it might be easily tricked with different code. Needs full-fledged exception tracking. That's why it's still open. |
Fixed by: phpstan/phpstan-src#481 |
Closes phpstan/phpstan#1597 Closes phpstan/phpstan#3617 Closes phpstan/phpstan#778 Closes phpstan/phpstan#2969 Closes phpstan/phpstan#3004 Closes phpstan/phpstan#3710 Closes phpstan/phpstan#3822 Closes phpstan/phpstan#505 Closes phpstan/phpstan#1670 Closes phpstan/phpstan#1219
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. |
If you use switch in catch block phpstan you get error that variable might not be defined.
Code snippet that reproduces the problem
https://phpstan.org/r/340e85cc81407dc0e0173b8cce5ada9a
Expected output
No errors
The text was updated successfully, but these errors were encountered: