File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff 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
122131Outside 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
You can’t perform that action at this time.
0 commit comments