Skip to content

and, or, & xor logical operators aren't checked against variable-setting #99

Open
@sybrew

Description

@sybrew

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions