Skip to content

Commit 429e193

Browse files
[ExpressionLanguage] Add support for <<, >>, and ~ bitwise operators
1 parent dae3dfe commit 429e193

File tree

1 file changed

+40
-32
lines changed

1 file changed

+40
-32
lines changed

reference/formats/expression_language.rst

+40-32
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,14 @@ Bitwise Operators
284284
* ``&`` (and)
285285
* ``|`` (or)
286286
* ``^`` (xor)
287+
* ``~`` (not)
288+
* ``<<`` (left shift)
289+
* ``>>`` (right shift)
290+
291+
.. versionadded:: 7.2
292+
293+
Support for the ``~``, ``<<`` and ``>>`` bitwise operators was introduced
294+
in Symfony 7.2.
287295

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

452-
+----------------------------------------------------------+---------------+
453-
| Operators | Associativity |
454-
+==========================================================+===============+
455-
| ``-`` , ``+`` (unary operators that add the number sign) | none |
456-
+----------------------------------------------------------+---------------+
457-
| ``**`` | right |
458-
+----------------------------------------------------------+---------------+
459-
| ``*``, ``/``, ``%`` | left |
460-
+----------------------------------------------------------+---------------+
461-
| ``not``, ``!`` | none |
462-
+----------------------------------------------------------+---------------+
463-
| ``~`` | left |
464-
+----------------------------------------------------------+---------------+
465-
| ``+``, ``-`` | left |
466-
+----------------------------------------------------------+---------------+
467-
| ``..`` | left |
468-
+----------------------------------------------------------+---------------+
469-
| ``==``, ``===``, ``!=``, ``!==``, | left |
470-
| ``<``, ``>``, ``>=``, ``<=``, | |
471-
| ``not in``, ``in``, ``contains``, | |
472-
| ``starts with``, ``ends with``, ``matches`` | |
473-
+----------------------------------------------------------+---------------+
474-
| ``&`` | left |
475-
+----------------------------------------------------------+---------------+
476-
| ``^`` | left |
477-
+----------------------------------------------------------+---------------+
478-
| ``|`` | left |
479-
+----------------------------------------------------------+---------------+
480-
| ``and``, ``&&`` | left |
481-
+----------------------------------------------------------+---------------+
482-
| ``or``, ``||`` | left |
483-
+----------------------------------------------------------+---------------+
460+
+-----------------------------------------------------------------+---------------+
461+
| Operators | Associativity |
462+
+=================================================================+===============+
463+
| ``-`` , ``+``, ``~`` (unary operators that add the number sign) | none |
464+
+-----------------------------------------------------------------+---------------+
465+
| ``**`` | right |
466+
+-----------------------------------------------------------------+---------------+
467+
| ``*``, ``/``, ``%`` | left |
468+
+-----------------------------------------------------------------+---------------+
469+
| ``not``, ``!`` | none |
470+
+-----------------------------------------------------------------+---------------+
471+
| ``~`` | left |
472+
+-----------------------------------------------------------------+---------------+
473+
| ``+``, ``-`` | left |
474+
+-----------------------------------------------------------------+---------------+
475+
| ``..``, ``<<``, ``>>`` | left |
476+
+-----------------------------------------------------------------+---------------+
477+
| ``==``, ``===``, ``!=``, ``!==``, | left |
478+
| ``<``, ``>``, ``>=``, ``<=``, | |
479+
| ``not in``, ``in``, ``contains``, | |
480+
| ``starts with``, ``ends with``, ``matches`` | |
481+
+-----------------------------------------------------------------+---------------+
482+
| ``&`` | left |
483+
+-----------------------------------------------------------------+---------------+
484+
| ``^`` | left |
485+
+-----------------------------------------------------------------+---------------+
486+
| ``|`` | left |
487+
+-----------------------------------------------------------------+---------------+
488+
| ``and``, ``&&`` | left |
489+
+-----------------------------------------------------------------+---------------+
490+
| ``or``, ``||`` | left |
491+
+-----------------------------------------------------------------+---------------+
484492

485493
Built-in Objects and Variables
486494
------------------------------

0 commit comments

Comments
 (0)