Skip to content

Call to function is_null() with Foo|null will always evaluate to false in do-while loop condition #9445

@fluffycondor

Description

@fluffycondor

Bug report

PHPStan yields Call to function is_null() with Foo|null will always evaluate to false in do-while loop condition 😅
Looks like this inspection requires some sanity check.

Code snippet that reproduces the problem

https://phpstan.org/r/2d8b2acc-3876-4bfc-96c6-2a2b2eb90152
Comparing to null yields no error though: https://phpstan.org/r/e57127e3-6917-4b25-82ad-4bfd4c840d2d

Expected output

No errors.

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

✨ 💌 ✨

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions