Skip to content

try-finally false positive #2969

@Firtzberg

Description

@Firtzberg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions