Skip to content

Commit cc4fd37

Browse files
committed
feature #9665 [VarDumper] dd() helper method tip (snoek09, javiereguiluz)
This PR was merged into the master branch. Discussion ---------- [VarDumper] dd() helper method tip This fixes #9661. Commits ------- a82d95f Minor rewords dd715fc dd() helper method tip
2 parents 718fb24 + a82d95f commit cc4fd37

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

components/var_dumper.rst

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,15 @@ current PHP SAPI:
8282
#. From time to time, run ``composer global update symfony/var-dumper``
8383
to have the latest bug fixes.
8484

85+
.. tip::
86+
87+
The VarDumper component also includes a ``dd()`` helper method. This "dump
88+
and die" feature calls ``dump()`` and stops the application immediately
89+
after with ``exit()``.
90+
91+
.. versionadded:: 4.1
92+
The ``dd()`` helper method was introduced in Symfony 4.1.
93+
8594
DebugBundle and Twig Integration
8695
--------------------------------
8796

@@ -93,8 +102,9 @@ of your application may just break it by e.g. sending HTTP headers or
93102
corrupting your view, the bundle configures the ``dump()`` function so that
94103
variables are dumped in the web debug toolbar.
95104

96-
But if the toolbar cannot be displayed because you e.g. called ``die``/``exit``
97-
or a fatal error occurred, then dumps are written on the regular output.
105+
But if the toolbar cannot be displayed because you e.g. called
106+
``die()``/``exit()``/``dd()`` or a fatal error occurred, then dumps are written
107+
on the regular output.
98108

99109
In a Twig template, two constructs are available for dumping a variable.
100110
Choosing between both is mostly a matter of personal taste, still:

0 commit comments

Comments
 (0)