Skip to content

Infinite for loop vars not seen as defined #2806

@muglug

Description

@muglug
for (;;) {
  $a = "hello";
  break;
}

echo $a;

Expected: No issue
Actual: Variable $a might not be defined.

https://phpstan.org/r/19b1ac30-50b8-404b-9da8-9b1a3b6f90b1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions