Skip to content

Incorrect variable may not be defined #1865

@1ed

Description

@1ed

Summary of a problem or a feature request

"Variable $key might not be defined." reported incorrectly. The $key variable is a scalar bool value (not a reference) and it is assigned only once.

Code snippet that reproduces the problem

https://phpstan.org/r/a8eba03f-946a-426f-90af-7575659a6a9e

Expected output

Do not report this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions