Dump
API reference › Debug Core › Helper › Dump
Renders JSON-safe values as display or parsable strings for the debugger panels.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
asString() static | Renders a value as a display string: quoted strings, bare scalars, and 4-space-indented arrays without trailing commas. | Dump |
export() static | Renders a value as a parsable PHP expression: var_export() scalars and short-syntax arrays with trailing commas, omitting sequential integer keys. | Dump |
Method details
Section titled “Method details”asString()
Section titled “asString() ”public static function asString(mixed $value, int $depth = 10): stringRenders a value as a display string: quoted strings, bare scalars, and 4-space-indented arrays without trailing commas.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | mixed | JSON-safe value to render. |
$depth | int | Maximum nesting level rendered before collapsing to [...]. |
Returns
string: Display string.
export()
Section titled “export() ”public static function export(mixed $value): stringRenders a value as a parsable PHP expression: var_export() scalars and short-syntax arrays with trailing
commas, omitting sequential integer keys.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | mixed | JSON-safe value to render. |
Returns
string: Parsable PHP expression.