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

Skip to content

Commit fa48443

Browse files
committed
Tweaks
1 parent eb882f7 commit fa48443

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

components/property_access.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,20 +83,20 @@ You can also use multi dimensional arrays::
8383

8484
.. tip::
8585

86-
If the key of the array contains a dot ``.`` or a left squared bracket ``[``,
87-
it is possible to escape these characters with a backslash. In the above example,
88-
if the array key ``first_name`` becomes ``first.name``, accessing the value can
89-
be achieved like this::
86+
If the key of the array contains a dot ``.`` or a left square bracket ``[``,
87+
you must escape those characters with a backslash. In the above example,
88+
if the array key was ``first.name`` instead of ``first_name``, you should
89+
access its value as follows::
9090

9191
var_dump($propertyAccessor->getValue($persons, '[0][first\.name]')); // 'Wouter'
9292
var_dump($propertyAccessor->getValue($persons, '[1][first\.name]')); // 'Ryan'
9393

94-
Right squared brackets ``]`` don't need to be escaped.
94+
Right square brackets ``]`` don't need to be escaped in array keys.
9595

96-
.. versionadded:: 6.3
96+
.. versionadded:: 6.3
9797

98-
Escaping dots and left squared bracket in a property path was
99-
introduced in Symfony 6.3.
98+
Escaping dots and left square brackets in a property path was
99+
introduced in Symfony 6.3.
100100

101101
Reading from Objects
102102
--------------------

0 commit comments

Comments
 (0)