Skip to content

FN: always-true/always-false conditions involving object properties not reported #4341

@dktapps

Description

@dktapps

Bug report

The code sample should make it obvious, as well as the inconsistency with is_null().
strict-rules is enabled (it was the first thing I thought of).

Code snippet that reproduces the problem

https://phpstan.org/r/55a538eb-af0c-4d10-817d-a19cc255f74b

Expected output

Additional errors should be reported on lines 11 and 14 to report always-true and always-false comparisons respectively.

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