-
-
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
try-finally false positive #2969
Comments
Thanks. Right now you can work around it like this: https://phpstan.org/r/da18cec8-7577-4d42-b03b-8697da96438e |
I have the same issue in my code. |
@Firtzberg After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-22: Negated boolean expression is always false.
+No errors |
@e1himself After the latest commit in dev-master, PHPStan now reports different result with your code snippet: @@ @@
-16: Variable $success in isset() always exists and is not nullable.
+No errors |
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. |
Bug report
I have a try finally block. I want to make sure resources are cleaned up no matter what. I use a simple flag to keep track if the resource was consumed.
Code snippet that reproduces the problem
https://phpstan.org/r/d716d2ac-adc4-4f4a-bdc7-2576859f90ee
Expected output
The static analysis should not claim that the boolean expression at line 22 is always false.
The text was updated successfully, but these errors were encountered: