Skip to content

Parameter $callback of function array_map expects (callable(mixed): mixed)) #12317

Closed
phpstan/phpstan-src
#3763

Description

@psprokofiev

Bug report

Array Map requires mixed as a callable argument

Code snippet that reproduces the problem

https://phpstan.org/r/31bce9df-d1d8-4647-a763-fd6535709243

Expected output

PHPStan shouldn't detect any issue

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

No response

Activity

  1. ondrejmirtes commented on Dec 23, 2024

    @ondrejmirtes
    Member

    This is because of named arguments. This places is wrong and doesn't account for them: https://github.com/phpstan/phpstan-src/blob/aa4a1232d2fbd6460632cb55d337e18539757281/src/Parser/ArrayMapArgVisitor.php#L17-L28

  2. added this to the Easy fixes milestone on Dec 23, 2024
  3. staabm commented on Dec 24, 2024

    @staabm
    Contributor

    Please re-open. Its a valid bug

  4. github-actions commented on Aug 22, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  5. locked as resolved and limited conversation to collaborators on Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions