Skip to content

Incorrect "variable might not be defined" when using "continue 2" #1283

@stof

Description

@stof

Summary of a problem or a feature request

When the code is using continue 2 for a switch inside a loop, the variable defined in all other cases of the switch is still marked as not defined for the code running in the loop after the switch block, while it cannot be the case.

Code snippet that reproduces the problem

https://phpstan.org/r/7ea8280d7f815b255e3f5528dc5c4262

Expected output

should not detect any issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions