Constants

DUMP_LIGHT_ARRAY

DUMP_LIGHT_ARRAY = 1

DUMP_STRING_LENGTH

DUMP_STRING_LENGTH = 2

DUMP_COMMA_SEPARATOR

DUMP_COMMA_SEPARATOR = 4

DUMP_TRAILING_COMMA

DUMP_TRAILING_COMMA = 8

Properties

$defaultOutput

$defaultOutput

$line

$line

$lineDumper

$lineDumper

$outputStream

$outputStream

$decimalPoint

$decimalPoint

$indentPad

$indentPad

$flags

$flags

$charset

$charset

Methods

__construct()

__construct(callable|resource|string|null  $output = null, string|null  $charset = null, int  $flags) : mixed

Parameters

callable|resource|string|null $output

A line dumper callable, an opened stream or an output path, defaults to static::$defaultOutput

string|null $charset

The default character encoding to use for non-UTF8 strings

int $flags

A bit field of static::DUMP_* constants to fine tune dumps representation

Returns

mixed —

setOutput()

setOutput(callable|resource|string  $output) : callable|resource|string

Sets the output destination of the dumps.

Parameters

callable|resource|string $output

A line dumper callable, an opened stream or an output path

Returns

callable|resource|string —

The previous output destination

setCharset()

setCharset(string  $charset) : string

Sets the default character encoding to use for non-UTF8 strings.

Parameters

string $charset

The default character encoding to use for non-UTF8 strings

Returns

string —

The previous charset

setIndentPad()

setIndentPad(string  $pad) : string

Sets the indentation pad string.

Parameters

string $pad

A string that will be prepended to dumped lines, repeated by nesting level

Returns

string —

The previous indent pad

dump()

dump(\Symfony\Component\VarDumper\Cloner\Data  $data, callable|resource|string|true|null  $output = null) : string|null

Dumps a Data object.

Parameters

\Symfony\Component\VarDumper\Cloner\Data $data
callable|resource|string|true|null $output

A line dumper callable, an opened stream, an output path or true to return the dump

Returns

string|null —

The dump as string when $output is true

dumpLine()

dumpLine(int  $depth) : mixed

Dumps the current line.

Parameters

int $depth

The recursive depth in the dumped structure for the line being dumped, or -1 to signal the end-of-dump to the line dumper callable

Returns

mixed —

echoLine()

echoLine(string  $line, int  $depth, string  $indentPad) : mixed

Generic line dumper callback.

Parameters

string $line

The line to write

int $depth

The recursive depth in the dumped structure

string $indentPad

The line indent pad

Returns

mixed —

utf8Encode()

utf8Encode(string|null  $s) : string|null

Converts a non-UTF-8 string to UTF-8.

Parameters

string|null $s

The non-UTF-8 string to convert

Returns

string|null —

The string converted to UTF-8