Skip to content

Commit 9029c40

Browse files
authored
Dump output to 'php://stderr' instead of 'php://stdout' (#15)
1 parent 03d7156 commit 9029c40

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/var-dumper.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@
3030
$varCloner->setMaxItems(500);
3131
$varCloner->setMaxString($maxStringWidth);
3232

33+
// Send output to 'php://stderr' instead of 'php://stdout' to avoid breaking the output of the main script on debug
34+
CliDumper::$defaultOutput = 'php://stderr';
35+
3336
$cliDumper = new CliDumper(null, 'UTF-8', AbstractDumper::DUMP_COMMA_SEPARATOR);
3437
$cliDumper->setMaxStringWidth($maxStringWidth);
3538
$cliDumper->setIndentPad(' '); // Classic style

0 commit comments

Comments
 (0)