You have a precedence problem.
General rule:
Use or to join statments together (where you'd otherwise use an if).
Use || when you'll use the result of the operation (i.e. in an assignment, to pass to a function, etc).
Omitting parens from function calls has a few pitfalls, including this one. You might be better off using them.
In reply to Re: Variable assignment after logical OR
by ikegami
in thread Variable assignment after logical OR
by rq-2102
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |