Skip to content

array_map with several arrays should returns list #12223

@niconoe-

Description

@niconoe-

Bug report

Hello 🙂

When calling array_map with a callable and a single array as parameter, the return is an array with the same keys than the given array. But, when calling array_map with several arrays, the return is always a list.

Unfortunately, PHPStan still consider the return of such array_map calls as an array<int, …>, and when we try to PHPDoc this to describe the elements of the array, we got a error.

If the issue is only about the CallMap classes, I could try to provide a PR, but if this is something from the engine to change, I won't be able to provide anything, I'm afraid.

Thanks for your amazing tool!

Code snippet that reproduces the problem

https://phpstan.org/r/7b54a0b2-0a6b-4304-a017-8e3f9e2d3372

Expected output

No error

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

No response

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