Skip to content

Strict comparison using === between NAN and NAN will always evaluate to false #10297

@gnutix

Description

@gnutix

Bug report

Hello there!

I've just upgraded to the latest and greatest version of PHPStan (1.10.50) and this issue appeared :

Parameter #1 $array of function collectWithKeys expects array<'Not a Number', NAN>, array{Not a Number: NAN} given.

Code snippet that reproduces the problem

https://phpstan.org/r/8b7e5238-b4a6-46c9-9fc3-0ef7c3b2343e

Expected output

There should be no errors.

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

It allowed me to fix quite a lot of wrong PHPDocs ! 💪 Thank you for this invaluable tool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions