|
4 | 4 | +============+==================+=========+===============+===================================================================+ |
5 | 5 | | 512 | ``...`` | prefix | n/a | Spread operator | |
6 | 6 | +------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
7 | | -<<<<<<< HEAD |
8 | | -======= |
9 | | -| => 300 | ``|`` | infix | Left | Twig filter call | |
10 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
11 | | -| | ``(`` | | | Twig function call | |
12 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
13 | | -| | ``.``, ``?.`` | | | Get an attribute on a variable | |
14 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
15 | | -| | ``[`` | | | Array access | |
16 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
17 | | -| 500 | ``-`` | prefix | n/a | | |
18 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
19 | | -| | ``+`` | | | | |
20 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
21 | | -| 300 => 5 | ``??`` | infix | Right | Null coalescing operator (a ?? b) | |
22 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
23 | | -| 250 | ``=>`` | infix | Left | Arrow function (x => expr) | |
24 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
25 | | -| 200 | ``**`` | infix | Right | Exponentiation operator | |
26 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
27 | | -| 100 | ``is`` | infix | Left | Twig tests | |
28 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
29 | | -| | ``is not`` | | | Twig tests | |
30 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
31 | | -| 60 | ``*`` | infix | Left | | |
32 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
33 | | -| | ``/`` | | | | |
34 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
35 | | -| | ``//`` | | | Floor division | |
36 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
37 | | -| | ``%`` | | | | |
38 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
39 | | -| 50 => 70 | ``not`` | prefix | n/a | | |
40 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
41 | | -| 40 => 27 | ``~`` | infix | Left | | |
42 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
43 | | -| 30 | ``+`` | infix | Left | | |
44 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
45 | | -| | ``-`` | | | | |
46 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
47 | | -| 25 | ``..`` | infix | Left | | |
48 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
49 | | -| 20 | ``==`` | infix | Left | | |
50 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
51 | | -| | ``!=`` | | | | |
52 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
53 | | -| | ``<=>`` | | | | |
54 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
55 | | -| | ``<`` | | | | |
56 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
57 | | -| | ``>`` | | | | |
58 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
59 | | -| | ``>=`` | | | | |
60 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
61 | | -| | ``<=`` | | | | |
62 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
63 | | -| | ``not in`` | | | | |
64 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
65 | | -| | ``in`` | | | | |
66 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
67 | | -| | ``matches`` | | | | |
68 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
69 | | -| | ``starts with`` | | | | |
70 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
71 | | -| | ``ends with`` | | | | |
72 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
73 | | -| | ``has some`` | | | | |
74 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
75 | | -| | ``has every`` | | | | |
76 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
77 | | -| | ``===`` | | | | |
78 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
79 | | -| | ``!==`` | | | | |
80 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
81 | | -| 18 | ``b-and`` | infix | Left | | |
82 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
83 | | -| 17 | ``b-xor`` | infix | Left | | |
84 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
85 | | -| 16 | ``b-or`` | infix | Left | | |
86 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
87 | | -| 15 | ``and`` | infix | Left | | |
88 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
89 | | -| 12 | ``xor`` | infix | Left | | |
90 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
91 | | -| 10 | ``or`` | infix | Left | | |
92 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
93 | | -| 5 | ``?:``, ``? :`` | infix | Right | Elvis operator (a ?: b) | |
94 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
95 | | -| 0 | ``(`` | prefix | n/a | Explicit group expression (a) | |
96 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
97 | | -| | ``literal`` | | | A literal value (boolean, string, number, sequence, mapping, ...) | |
98 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
99 | | -| | ``?`` | infix | Left | Conditional operator (a ? b : c) | |
100 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
101 | | -| | ``=`` | | Right | Assignment operator | |
102 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
103 | | - |
104 | | -When a precedence will change in 4.0, the new precedence is indicated by the arrow ``=>``. |
105 | | - |
106 | | -Here is the same table for Twig 4.0 with adjusted precedences: |
107 | | - |
108 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
109 | | -| Precedence | Operator | Type | Associativity | Description | |
110 | | -+============+==================+=========+===============+===================================================================+ |
111 | | -| 512 | ``...`` | prefix | n/a | Spread operator | |
112 | | -+------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
113 | | ->>>>>>> 3.x |
114 | 7 | | | ``(`` | infix | Left | Twig function call | |
115 | 8 | +------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
116 | 9 | | | ``.``, ``?.`` | | | Get an attribute on a variable | |
@@ -203,10 +96,7 @@ Here is the same table for Twig 4.0 with adjusted precedences: |
203 | 96 | +------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
204 | 97 | | | ``?`` | infix | Left | Conditional operator (a ? b : c) | |
205 | 98 | +------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
206 | | -<<<<<<< HEAD |
207 | | - |
208 | | -When a precedence will change in the next major version, the new precedence is indicated by the arrow ``=>``. |
209 | | -======= |
210 | 99 | | | ``=`` | | Right | Assignment operator | |
211 | 100 | +------------+------------------+---------+---------------+-------------------------------------------------------------------+ |
212 | | ->>>>>>> 3.x |
| 101 | + |
| 102 | +When a precedence will change in the next major version, the new precedence is indicated by the arrow ``=>``. |
0 commit comments