Json
API reference › Debug Core › Storage › Json
Converts strings to JSON-safe debug storage representations.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
payload() static | Freezes a provider payload as JSON values before it enters the request envelope. | Json |
safeString() static | Returns valid UTF-8, representing binary text as base64. | Json |
Method details
Section titled “Method details”payload()
Section titled “payload() ”public static function payload(array<string, mixed> $payload): array<string, mixed>Freezes a provider payload as JSON values before it enters the request envelope.
Strict encoding rejects invalid UTF-8, non-finite numbers, resources, cycles, and excessive depth. Decoding freezes nested serialization results so application callbacks never run again during storage. The depth limit reserves room for the request envelope. No redaction or truncation is applied here.
Parameters
| Parameter | Type | Description |
|---|---|---|
$payload | array<string, |
Returns
array<string, mixed>
safeString()
Section titled “safeString() ”public static function safeString(string $value): stringReturns valid UTF-8, representing binary text as base64.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string | String to normalize. |
Returns
string: JSON-safe string.