Skip to content

array_map loses information about mapped result if the result is array #4275

@patrickkusebauch

Description

@patrickkusebauch

Bug report

In case I use array_map and the result of the callback function is an array, PHPStan loses the information about the content/structure of the array and there is no way to get it back.

Code snippet that reproduces the problem

https://phpstan.org/r/1602c5fc-dbc6-49a8-a307-7e60e935006c

Expected output

No error, Ideally without helping by adding the return annotation to the callback.

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