setColors(TRUE); $dumper->dump( $cloner->cloneVar($var), function ($line, $depth, $indent_pad) { // A negative depth means "end of dump". if ($depth >= 0) { // Adds a two spaces indentation to the line. fwrite(STDOUT, str_repeat($indent_pad, $depth) . $line . "\n"); } } ); } /** * A HTML handler for \Symfony\Component\VarDumper\VarDumper. */ public static function htmlHandler($var) { $cloner = new VarCloner(); $dumper = new HtmlDumper(); $dumper->dump($cloner->cloneVar($var)); } }