Skip to content

False positive "Result of ||/&& is always true." on version 0.10.3 #1377

@eclipxe13

Description

@eclipxe13

Summary of a problem or a feature request

Some evaluations of isset() || isset() and isset() && isset() are declared as a known result when it is not the case, resulting in an error:

Result of || is always true.
Result of && is always true.

This is fine on version 0.10.2 but failing on version 0.10.3

Code snippet that reproduces the problem

fooFail is the same as fooOk, the only difference the order of when isset() || isset() appears

barFail and barOk do the same, the difference here is that every if result in a return (stop continuity).

https://phpstan.org/r/a693726d28d0cbe675b08b423497bd41

Expected output

In any case this should not produce an error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions