Open
Description
Code speaks a thousand words. Replace and
with the other logical operators (or
, xor
), and the same error will yield.
$get_something_and_do_stuff = true;
$get_something_and_do_stuff
and $something = get_something()
and $something === 'something' // VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable
and do_stuff();
Variable $something is undefined.
(VariableAnalysis.CodeAnalysis.VariableAnalysis.UndefinedVariable)
This is tricky, however, because the logical operators may prevent or bypass assigning variables; especially when the or
-operator is used in sequence.