Skip to content

array_filter on union #10189

@staabm

Description

@staabm

Bug report

while working on phpstan/phpstan-src#2772 I realized that there is some problem in ArrayFilterFunctionReturnTypeReturnTypeExtension when working on unions.

Code snippet that reproduces the problem

https://phpstan.org/r/bb7a2e31-57a9-450c-bdc9-111e6acc7f8d

(reduced from drupal 10.0.0 real world code)

Expected output

since the arg passed to array_filter can be an array, I think the return type should not be NeverType

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions