Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cb0ee89

Browse filesBrowse files
§ about Data::getLimitedClone()
1 parent ee2d7e4 commit cb0ee89
Copy full SHA for cb0ee89

File tree

Expand file treeCollapse file tree

1 file changed

+17
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+17
-0
lines changed

‎components/var_dumper/advanced.rst

Copy file name to clipboardExpand all lines: components/var_dumper/advanced.rst
+17Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,23 @@ Before cloning, you can configure the limits with::
2727

2828
They will be applied when calling ``->cloneVar()`` afterwards.
2929

30+
Before dumping it, you can further limit the resulting
31+
:class:`Symfony\\Component\\VarDumper\\Cloner\\Data` object by calling its
32+
:method:`Symfony\\Component\\VarDumper\\Cloner\\Data::getLimitedClone`
33+
method:
34+
- the first `$maxDepth` argument allows limiting dumps in the depth dimension,
35+
- the second `$maxItemsPerDepth` limits the number of items per depth level,
36+
- and the last `$useRefHandles` defaults to `true` but allows removing internal
37+
objects' handles for sparser output,
38+
- but unlike the previous limits on cloners that remove data on purpose, these
39+
limits can be changed back and forth before dumping since they do not affect
40+
the intermediate representation internally.
41+
42+
.. note::
43+
When no limit is applied, a :class:`Symfony\\Component\\VarDumper\\Cloner\\Data`
44+
object is as accurate as the native :phpfunction:`serialize` function and thus
45+
could have a wider purpose than strictly dumping for debugging.
46+
3047
Dumpers
3148
~~~~~~~
3249

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.