File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Expand file tree Collapse file tree 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:
120120
121121* ``constant() ``
122122* ``enum() ``
123+ * ``min() ``
124+ * ``max() ``
123125
124126``constant() `` function
125127~~~~~~~~~~~~~~~~~~~~~~~
@@ -167,6 +169,32 @@ This function will return the case of an enumeration::
167169
168170This will print out ``true ``.
169171
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+
170198.. tip ::
171199
172200 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