Skip to content

Commit d361931

Browse files
committed
minor #16593 [ExpressionLanguage] Add support for new number syntax (javiereguiluz)
This PR was squashed before being merged into the 6.1 branch. Discussion ---------- [ExpressionLanguage] Add support for new number syntax Fixes #16541. Commits ------- 77d46f3 [ExpressionLanguage] Add support for new number syntax
2 parents a44b5cc + 77d46f3 commit d361931

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

components/expression_language/syntax.rst

+9-1
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,21 @@ Supported Literals
1414
The component supports:
1515

1616
* **strings** - single and double quotes (e.g. ``'hello'``)
17-
* **numbers** - e.g. ``103``
17+
* **numbers** - integers (e.g. ``103``), decimals (e.g. ``9.95``), decimals
18+
without leading zeros (e.g. ``.99``, equivalent to ``0.99``); all numbers
19+
support optional underscores as separators to improve readability (e.g.
20+
``1_000_000``, ``3.14159_26535``)
1821
* **arrays** - using JSON-like notation (e.g. ``[1, 2]``)
1922
* **hashes** - using JSON-like notation (e.g. ``{ foo: 'bar' }``)
2023
* **booleans** - ``true`` and ``false``
2124
* **null** - ``null``
2225
* **exponential** - also known as scientific (e.g. ``1.99E+3`` or ``1e-2``)
2326

27+
.. versionadded:: 6.1
28+
29+
Support for decimals without leading zeros and underscore separators were
30+
introduced in Symfony 6.1.
31+
2432
.. caution::
2533

2634
A backslash (``\``) must be escaped by 4 backslashes (``\\\\``) in a string

0 commit comments

Comments
 (0)