Skip to content

Commit 5b152cf

Browse files
committed
minor #10275 Added docs for VAR_DUMPER_FORMAT (javiereguiluz)
This PR was merged into the master branch. Discussion ---------- Added docs for VAR_DUMPER_FORMAT This fixes #10274. Commits ------- 3924e18 Added docs for VAR_DUMPER_FORMAT
2 parents a6b0c60 + 3924e18 commit 5b152cf

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

components/var_dumper.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ current PHP SAPI:
6464
mechanism;
6565
* On other SAPIs, dumps are written as HTML in the regular output.
6666

67+
.. tip::
68+
69+
You can also select the output format explicitly defining the
70+
``VAR_DUMPER_FORMAT`` environment variable and setting its value to either
71+
``html`` or ``cli``.
72+
73+
.. versionadded:: 4.2
74+
The ``VAR_DUMPER_FORMAT`` env var was introduced in Symfony 4.2.
75+
6776
.. note::
6877

6978
If you want to catch the dump output as a string, please read the
@@ -122,14 +131,14 @@ the :ref:`dump_destination option <configuration-debug-dump_destination>` of the
122131
Outside a Symfony application, use the ``ServerDumper`` class::
123132

124133
require __DIR__.'/vendor/autoload.php';
125-
134+
126135
use Symfony\Component\VarDumper\VarDumper;
127136
use Symfony\Component\VarDumper\Cloner\VarCloner;
128137
use Symfony\Component\VarDumper\Dumper\ServerDumper;
129-
138+
130139
VarDumper::setHandler(function ($var) {
131140
$cloner = new VarCloner();
132-
$dumper = new ServerDumper('tcp://127.0.0.1:9912');
141+
$dumper = new ServerDumper('tcp://127.0.0.1:9912');
133142
$dumper->dump($cloner->cloneVar($var));
134143
});
135144

0 commit comments

Comments
 (0)