Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 40 additions & 32 deletions reference/formats/expression_language.rst
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@ Bitwise Operators
* ``&`` (and)
* ``|`` (or)
* ``^`` (xor)
* ``~`` (not)
* ``<<`` (left shift)
* ``>>`` (right shift)

.. versionadded:: 7.2

Support for the ``~``, ``<<`` and ``>>`` bitwise operators was introduced
in Symfony 7.2.

Comparison Operators
~~~~~~~~~~~~~~~~~~~~
Expand Down Expand Up @@ -449,38 +457,38 @@ parentheses in your expressions (e.g. ``(1 + 2) * 4`` or ``1 + (2 * 4)``.
The following table summarizes the operators and their associativity from the
**highest to the lowest precedence**:

+----------------------------------------------------------+---------------+
| Operators | Associativity |
+==========================================================+===============+
| ``-`` , ``+`` (unary operators that add the number sign) | none |
+----------------------------------------------------------+---------------+
| ``**`` | right |
+----------------------------------------------------------+---------------+
| ``*``, ``/``, ``%`` | left |
+----------------------------------------------------------+---------------+
| ``not``, ``!`` | none |
+----------------------------------------------------------+---------------+
| ``~`` | left |
+----------------------------------------------------------+---------------+
| ``+``, ``-`` | left |
+----------------------------------------------------------+---------------+
| ``..`` | left |
+----------------------------------------------------------+---------------+
| ``==``, ``===``, ``!=``, ``!==``, | left |
| ``<``, ``>``, ``>=``, ``<=``, | |
| ``not in``, ``in``, ``contains``, | |
| ``starts with``, ``ends with``, ``matches`` | |
+----------------------------------------------------------+---------------+
| ``&`` | left |
+----------------------------------------------------------+---------------+
| ``^`` | left |
+----------------------------------------------------------+---------------+
| ``|`` | left |
+----------------------------------------------------------+---------------+
| ``and``, ``&&`` | left |
+----------------------------------------------------------+---------------+
| ``or``, ``||`` | left |
+----------------------------------------------------------+---------------+
+-----------------------------------------------------------------+---------------+
| Operators | Associativity |
+=================================================================+===============+
| ``-`` , ``+``, ``~`` (unary operators that add the number sign) | none |
+-----------------------------------------------------------------+---------------+
| ``**`` | right |
+-----------------------------------------------------------------+---------------+
| ``*``, ``/``, ``%`` | left |
+-----------------------------------------------------------------+---------------+
| ``not``, ``!`` | none |
+-----------------------------------------------------------------+---------------+
| ``~`` | left |
+-----------------------------------------------------------------+---------------+
| ``+``, ``-`` | left |
+-----------------------------------------------------------------+---------------+
| ``..``, ``<<``, ``>>`` | left |
+-----------------------------------------------------------------+---------------+
| ``==``, ``===``, ``!=``, ``!==``, | left |
| ``<``, ``>``, ``>=``, ``<=``, | |
| ``not in``, ``in``, ``contains``, | |
| ``starts with``, ``ends with``, ``matches`` | |
+-----------------------------------------------------------------+---------------+
| ``&`` | left |
+-----------------------------------------------------------------+---------------+
| ``^`` | left |
+-----------------------------------------------------------------+---------------+
| ``|`` | left |
+-----------------------------------------------------------------+---------------+
| ``and``, ``&&`` | left |
+-----------------------------------------------------------------+---------------+
| ``or``, ``||`` | left |
+-----------------------------------------------------------------+---------------+

Built-in Objects and Variables
------------------------------
Expand Down