Skip to content

iterator_to_array never returns mixed key, it throws TypeError instead #5396

@vudaltsov

Description

@vudaltsov

https://psalm.dev/r/ce986a03b8

I think the issue raised by Psalm is not correct. While iterator_to_array does throw a TypeError in case of a non-scalar key (https://3v4l.org/BBOJF), the returned type of iterator_to_array(T, true) is never array<mixed, T>, it is array<array-key, T>.

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