-
-
Notifications
You must be signed in to change notification settings - Fork 930
Closed
Labels
Description
Bug report
Logical operations can be used as standalone statements, therefore as shorthand if:
Code snippet that reproduces the problem
$ifTrue && $obj->setVal();
PHPStan erroneously expects these operations to be used as evaluated values, not as standalone statements.
Only booleans are allowed in &&, void given on the right side.
Right side of && is always false.
https://phpstan.org/r/b03ddbd5-bc16-45e3-8ffa-5f971cf0f72f
Expected output
The operation should be ignored or only report an error if one part will NEVER be executed.