File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,8 @@ following functions by default:
120
120
121
121
* ``constant() ``
122
122
* ``enum() ``
123
+ * ``min() ``
124
+ * ``max() ``
123
125
124
126
``constant() `` function
125
127
~~~~~~~~~~~~~~~~~~~~~~~
@@ -167,6 +169,32 @@ This function will return the case of an enumeration::
167
169
168
170
This will print out ``true ``.
169
171
172
+ ``min() `` function
173
+ ~~~~~~~~~~~~~~~~~~
174
+
175
+ This function will return the lowest value::
176
+
177
+ var_dump($expressionLanguage->evaluate(
178
+ 'min(1, 2, 3)'
179
+ ));
180
+
181
+ This will print out ``1 ``.
182
+
183
+ ``max() `` function
184
+ ~~~~~~~~~~~~~~~~~~
185
+
186
+ This function will return the highest value::
187
+
188
+ var_dump($expressionLanguage->evaluate(
189
+ 'max(1, 2, 3)'
190
+ ));
191
+
192
+ This will print out ``3 ``.
193
+
194
+ .. versionadded :: 7.1
195
+
196
+ The ``min() `` and ``max() `` functions were introduced in Symfony 7.1.
197
+
170
198
.. tip ::
171
199
172
200
To read how to register your own functions to use in an expression, see
You can’t perform that action at this time.
0 commit comments