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

Skip to content

Type information lost in foreach #6912

@greg0ire

Description

@greg0ire

Bug report

Since 1.5.0, I have a new error on one of my project. I'm not sure why it kicks in now but it seems that PHPStan loses type information when inside a foreach now, or performs more checks than before

Code snippet that reproduces the problem

https://phpstan.org/r/8ab8b229-f6ea-4acd-9fce-8d6aa4a69887

Expected output

No issues.

Did PHPStan help you today? Did it make you happy in any way?

It makes me happy every day.

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