Skip to content

Incorrect array_search() type under certain conditions #7809

@zeriyoshi

Description

@zeriyoshi

Bug report

Passing the $strict argument of array_search() from a function reports the possibility of null being returned.

Code snippet that reproduces the problem

https://phpstan.org/r/063ed345-07db-45c1-8b05-0fee820294cd

Expected output

array_search() will never return null in any case.

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

Thanks to PHPStan, various bugs have been prevented. Awesome!

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