Skip to content

isset($notDefined) is not working in foreach #3985

@voku

Description

@voku

Bug report

Undefined variables are not detected inside "isset()" + foreach

Code snippet that reproduces the problem

https://phpstan.org/r/98c8d071-a9a6-496a-a7bd-0d5dbe680441

Expected output

ERROR: UndefinedVariable - 10:14 - Cannot find referenced variable $foo

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions