Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Variable inside loop might not be defined. #6830

@hocker1

Description

@hocker1

Code snippet here:

https://phpstan.org/r/37400131-6bac-49dd-9088-5fa3614957bf

The variable is "always true" and "might not be defined" at the same time, which doesn't make any sense to me. Without the "foreach" phpstan handles the code correctly.

P.S.: Thank You for awesome tool (phpstan), which helps me with refactoring legacy code a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions