Logical operations
| Operator | Summary |
|---|---|
| and | Evaluates all parameters to check if any are evaluated as FALSE |
| choose | Returns one of the parameters (pinpointed by the input parameter). |
| cond | Returns the value of the first clause who's condition is TRUE. |
| eq | Returns TRUE if the input equals the first parameter or if all parameters are equal. |
| false | Creates and returns a boolean FALSE. |
| first_set | Returns the first parameter that is set (or FALSE). |
| ge | Returns TRUE if a parameter is greater than or equal to another parameter. |
| gt | Returns TRUE if a parameter is greater than another parameter. |
| le | Returns TRUE if a parameter is less than or equal to another parameter. |
| lt | Returns TRUE if a parameter is less than another parameter. |
| ne | Returns TRUE if one or more of the parameters do not match. |
| not | Returns the opposite of the input or the first parameter (TRUE/FALSE). |
| null | Returns TRUE if the input value is NULL (not the same as 0). |
| or | Evaluates all parameters until one is found to be TRUE, returns that value. |
| true | Creates and returns a boolean TRUE. |
In this section
- and This operator evaluates all parameters. When one of them is found to be FALSE, the operator will then return that parameter. Under some circumstances shortcutting is then applied, which means that once a parameter in found to be FALSE, the evaluation of the rest of the parameters stops. However this
- choose Exponential Documentation
- cond Exponential Documentation
- eq This operator compares the contents of two or more variables and/or values. If the input parameter is used, the operator will compare it with the first parameter. If the provided variables/values match, the operator will return TRUE, otherwise FALSE will be returned. If more than one parameter is pr
- false This operator creates and returns a boolean FALSE. It can be used to define a boolean variable and in logical comparisons.
- first_set This operator evaluates all parameters until one of them is found to be set. The parameter that is found to be set will be returned. If none of the parameters are set, the operator will return FALSE.
- ge Exponential Documentation
- gt Exponential Documentation
- le Exponential Documentation
- lt Exponential Documentation
- ne Exponential Documentation
- not This operator returns TRUE if the input value is FALSE and vice versa. It is also possible to use the optional "test" parameter for evaluation. If both the input parameter and the "test" parameter are used, it is the input parameter that will be evaluated.
- null This operator returns TRUE if the input value is NULL, otherwise FALSE will be returned. Please note that NULL is not the same as a numeric zero (0).
- or This operator evaluates all parameters until one of them is found to be TRUE. The operator will then return that parameter and thus stop evaluating the rest of the parameters. If none of the parameters are found to be TRUE, the operator will return FALSE. The following table shows how the different
- true This operator creates and returns a boolean TRUE. It can be used to define a boolean variable and in logical comparisons.
Contributors
- Balazs Halasy Updated
- Kristian Hole Commenter
Comments (1 historical)
Written by readers of the earlier documentation sites, kept as they were.
Comparison Operators
Kristian Hole ·
The comparison operators are evaluated the same way as they are done in PHP. This can lead to interesting results like the fact that {'0.10'|ne(0)} evaluates to false.
See the following reference:
http://www.php.net/manual/en/language.operators.comparison.php