Skip to content

Unset detection with try/catch does not take into account origin of the exception. #3822

@frankdejonge

Description

@frankdejonge

Bug report

When an unset call is placed after a call where an exception can originate from, the catch clause is not able to use the variable, even though the unset call can never be made.

Code snippet that reproduces the problem

https://phpstan.org/r/abf2e5c9-90a3-40fc-9979-6d19255e7c67

Expected output

No errors were found

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions