Skip to content
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