Estas constantes están definidas por esta extensión y estarán disponibles sólo cuando la extensión haya sido compilada con PHP, o bien sea cargada dinámicamente en ejecución.
Las siguientes constantes indican el tipo de error retornado por json_last_error().
JSON_ERROR_NONE
(integer) JSON_ERROR_DEPTH
(integer) JSON_ERROR_STATE_MISMATCH
(integer) JSON_ERROR_CTRL_CHAR
(integer) JSON_ERROR_SYNTAX
(integer) JSON_ERROR_UTF8
(integer) JSON_ERROR_RECURSION
(integer) El objeto o array pasado a json_encode() incluye referencias recursivas y no se puede codificar. Si se proporcionó la opción JSON_PARTIAL_OUTPUT_ON_ERROR
, se codificará null
en el lugar de la referencia recursiva.
Esta constante está disponible a partir de PHP 5.5.0.
JSON_ERROR_INF_OR_NAN
(integer) El valor pasado a json_encode() incluye NAN
o INF
. Si se proporcionó la opción JSON_PARTIAL_OUTPUT_ON_ERROR
, se codificará 0
en el lugar de estos números especiales.
Esta constante está disponible a partir de PHP 5.5.0.
JSON_ERROR_UNSUPPORTED_TYPE
(integer) Se proporcionó un valor de un tipo no admitido para json_encode(), tal como un resource. Si se proporcionó la opción JSON_PARTIAL_OUTPUT_ON_ERROR
, se codificará null
en el lugar del valor no admitido.
Esta constante está disponible a partir de PHP 5.5.0.
Las siguientes constantes se pueden combinar para obtener opciones para json_encode().
JSON_HEX_TAG
(integer) JSON_HEX_AMP
(integer) JSON_HEX_APOS
(integer) JSON_HEX_QUOT
(integer) JSON_FORCE_OBJECT
(integer) JSON_NUMERIC_CHECK
(integer) JSON_BIGINT_AS_STRING
(integer) JSON_PRETTY_PRINT
(integer) JSON_UNESCAPED_SLASHES
(integer) /
. Disponible desde PHP 5.4.0. JSON_UNESCAPED_UNICODE
(integer) JSON_PARTIAL_OUTPUT_ON_ERROR
(integer) JSON_PRESERVE_ZERO_FRACTION
(integer)