Skip to content

Incorrect "Variable might not be defined" with a try/catch #3302

@VincentLanglet

Description

@VincentLanglet

Bug report

Code snippet that reproduces the problem

I have an error with
https://phpstan.org/r/b33506ff-66aa-45c9-8d81-db3fa4227b0b

The following code is working https://phpstan.org/r/f04ed63c-88c0-4169-9ed0-97b1f92daa92
But when I throw an exception inside the try, it's not working anymore.

Expected output

No error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions