json_encode_with_error

Like json_encode, but includes json_last_error(_msg) results

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

Parameters

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

Returns

  • mixed