Skip to content
PHP Ecosystem
Explore

Dump

API reference › Debug Core › Helper › Dump

final classPHPForge\Debug\Helper\Dump
Sourcesrc/Helper/Dump.php

Renders JSON-safe values as display or parsable strings for the debugger panels.

MethodDescriptionDefined by
asString() staticRenders a value as a display string: quoted strings, bare scalars, and 4-space-indented arrays without trailing commas.Dump
export() staticRenders a value as a parsable PHP expression: var_export() scalars and short-syntax arrays with trailing commas, omitting sequential integer keys.Dump
public static function asString(mixed $value, int $depth = 10): string

Renders a value as a display string: quoted strings, bare scalars, and 4-space-indented arrays without trailing commas.

Parameters

ParameterTypeDescription
$valuemixedJSON-safe value to render.
$depthintMaximum nesting level rendered before collapsing to [...].

Returns

string: Display string.

public static function export(mixed $value): string

Renders a value as a parsable PHP expression: var_export() scalars and short-syntax arrays with trailing commas, omitting sequential integer keys.

Parameters

ParameterTypeDescription
$valuemixedJSON-safe value to render.

Returns

string: Parsable PHP expression.