json_encode_pure

Like json_encode_with_error but has pure coeffects

function json_encode_pure(
  mixed $value,
  inout ?(int, string) $error,
  int $options = 0,
  int $depth = 512,
): mixed;

Encoding objects implementing JsonSerializable with an impure jsonSerialize will result in coeffect violations.

Parameters

  • mixed $value
  • inout ?(int, string) $error
  • int $options = 0
  • int $depth = 512

Returns

  • mixed