function AbstractDumper::setOutput
Sets the output destination of the dumps.
Parameters
callable|resource|string|null $output A line dumper callable, an opened stream or an output path:
Return value
callable|resource|string|null The previous output destination
2 calls to AbstractDumper::setOutput()
- AbstractDumper::dump in vendor/
symfony/ var-dumper/ Dumper/ AbstractDumper.php - Dumps a Data object.
- AbstractDumper::__construct in vendor/
symfony/ var-dumper/ Dumper/ AbstractDumper.php
File
-
vendor/
symfony/ var-dumper/ Dumper/ AbstractDumper.php, line 66
Class
- AbstractDumper
- Abstract mechanism for dumping a Data object.
Namespace
Symfony\Component\VarDumper\DumperCode
public function setOutput($output) {
$prev = $this->outputStream ?? $this->lineDumper;
if (\is_callable($output)) {
$this->outputStream = null;
$this->lineDumper = $output;
}
else {
if (\is_string($output)) {
$output = fopen($output, 'w');
}
$this->outputStream = $output;
$this->lineDumper = $this->echoLine(...);
}
return $prev;
}