Skip to content

\Ds\Map: Undefined method Ds\Map<int, int>::getIterator(). #3513

@jkuchar

Description

@jkuchar

Bug report

maybe related #3512

Code snippet that reproduces the problem

https://phpstan.org/r/fb68a357-4574-4274-867b-126e8a6f3775

It looks like phpstan does no know that Map does implement IteratorAggregate, which provides this method.

Strage related behaviour is also with detecting unreachable code this works and this does not.

Expected output

Code to pass validation.

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