You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think it's feasible to create a fix for this, however. Consider these scenarios, where every instance of true/false may be a function or variable call which you can't test.
Positives:
false
and $something = true
or 'value' === $something; // warning
true
and $something = true
or 'value' === $something; // warning, never runs.
false
or $something = false
and 'value' === $something; // warning, never runs.
False positives:
false
or $something = true
and 'value' === $something; // warning that's incorrect
False negatives:
false
and $something = true;
if ( $something ) { // no warning, but it's undefined...returnfalse;
}
Code speaks a thousand words. Replace
and
with the other logical operators (or
,xor
), and the same error will yield.This is tricky, however, because the logical operators may prevent or bypass assigning variables; especially when the
or
-operator is used in sequence.The text was updated successfully, but these errors were encountered: