final class Json (View source)

internal  This class is not covered by the backward compatibility promise for PHPUnit
 

Methods

static string
prettify(string $json)

No description

static array
canonicalize(string $json)

Element 0 is true and element 1 is null when JSON decoding did not work.

Details

static string prettify(string $json)

No description

Parameters

string $json

Return Value

string

Exceptions

InvalidJsonException

static array canonicalize(string $json)

Element 0 is true and element 1 is null when JSON decoding did not work.

  • Element 0 is false and element 1 has the decoded value when JSON decoding did work.
  • This is used to avoid ambiguity with JSON strings consisting entirely of 'null' or 'false'.

Parameters

string $json

Return Value

array