DebugArray
API reference › Debug Core › Storage › DebugArray
Represents a PHP array with arbitrary nested values as JSON-safe debug data.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
capture() static | Captures an array as tagged debug data. | DebugArray |
fromArray() static | Hydrates a tagged debug array from decoded JSON data. | DebugArray |
jsonSerialize() | Returns the tagged array for JSON serialization. | DebugArray |
values() | Returns captured entries as display-safe PHP values. | DebugArray |
Method details
Section titled “Method details”capture()
Section titled “capture() ”public static function capture(array<array-key, mixed> $value): selfCaptures an array as tagged debug data.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | array<array-key, | PHP values to capture. |
Returns
self: Tagged array facade.
fromArray()
Section titled “fromArray() ”public static function fromArray(mixed $value, string $path): selfHydrates a tagged debug array from decoded JSON data.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | mixed | Decoded tagged value. |
$path | string | Payload path used in hydration errors. |
Returns
self: Hydrated array facade.
jsonSerialize()
Section titled “jsonSerialize() ”public function jsonSerialize(): array<string, mixed>Returns the tagged array for JSON serialization.
Returns
array<string, mixed>: Tagged array payload.
values()
Section titled “values() ”public function values(): array<array-key, mixed>Returns captured entries as display-safe PHP values.
Returns
array<array-key, mixed>: Display-safe PHP values.