Boolean Operators

These boolean operators treat the values they operate on (operands) as true/false values:

Operator

Returns @true if:

&&

The first and second values are both true. Added in v1.1.

||

Either the first or second value is true. Added in v1.1.

!

The single value directly following it is false. Added in v1.1.

NOTE: as of v3.1 the binary operators && and || follow short-circuit evaluation behavior, where only the first operand is evaluated if possible. In prior versions both operands were always evaluated.

The following are operators that modify the first value (on the left side “lvalue”) using the second value (on the right side). The first value must be an assignable value like a variable (eg: $count += 1).

Operator


+=

the second value is added to the first value. Added in v1.0.1.

-=

the second value is subtracted from the first value. Added in v1.0.1.

&=

both values are treated as strings and concatenated (eg: the string on the right of the operator is appended to the string on the left). Added in v1.1. 


Previous Chapter
Comparison Operators
<<  index  >>
 
Next Chapter
Expression Limitations