Skip to content

array_filter with assert-if-true callable marks all keys optional #11730

Description

@aymanrady

Bug report

using a callable with assert-if-true marks all keys as optional, while a conditional return correctly filters the array.

Code snippet that reproduces the problem

https://phpstan.org/r/dffd6a59-f5b1-4f8e-b23c-5b55e9680915

Expected output

Expected assertions to pass

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

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions