Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[ExpressionLanguage] Add support for new number syntax #16593

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion components/expression_language/syntax.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,21 @@ Supported Literals
The component supports:

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

.. versionadded:: 6.1

Support for decimals without leading zeros and underscore separators were
introduced in Symfony 6.1.

.. caution::

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