Skip to content

array_map without side-effects #11710

@staabm

Description

@staabm

Feature request

I think we should report an error in https://phpstan.org/r/c03e1b48-6cea-4ee2-a606-9e0c93312be6 because its effictively dead code

something like

Call to function array_map() on a separate line has no effect.

same for

  • array_filter
  • array_reduce

we should not produce an error in case the callable has by-ref or closure-use semantics

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