Skip to content

Null comparison detection stored on a variable not considered on if statement #801

@soullivaneuh

Description

@soullivaneuh

Summary of a problem or a feature request

When a null comparison is store on a variable, it not considered by PHPSTan.

It's a retry of #800. There is already #647 and #701 about assignments in conditions, but I'm not sure it's related. For my case, it's not directly an assignment but a comparison stored on a boolean variable.

See the sample. If it's indeed the same issue, sorry for that and feel free to close. 👍

Code snippet that reproduces the problem

https://phpstan.org/r/24dc69b2-908a-4137-842c-c4880a6d1f59

Expected output

Nothing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions