Skip to content

bool|null is accepted in an if condition if you use the nullsafe operator. #135

@Dgame

Description

@Dgame

Bug report

bool|null is accepted in an if condition if you use the nullsafe operator.

Code snippet that reproduces the problem

No error for line 13:
https://phpstan.org/r/6866ee85-dfc4-4b09-9b39-83861c2cdda6

Expected output

I expected the error Only booleans are allowed in an if condition, bool|null given.

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