Ces constantes sont définies par cette extension, et ne sont disponibles que si cette extension a été compilée avec PHP, ou bien chargée au moment de l'exécution.
Les constantes suivantes indiquent le type d'erreur retournée par json_last_error() ou stockée en tant que code d'une JsonException.
JSON_ERROR_NONE
    (int)
   JSON_ERROR_DEPTH
    (int)
   JSON_ERROR_STATE_MISMATCH
    (int)
   JSON_ERROR_CTRL_CHAR
    (int)
   JSON_ERROR_SYNTAX
    (int)
   JSON_ERROR_UTF8
    (int)
   JSON_ERROR_RECURSION
    (int)
   JSON_PARTIAL_OUTPUT_ON_ERROR a été fournie,
     null sera encodé à la place de la référence récursive.
    
   JSON_ERROR_INF_OR_NAN
    (int)
   NAN,
     soit INF.
     Si l'option JSON_PARTIAL_OUTPUT_ON_ERROR a été fournie,
     0 sera encodé à la place de ces nombres spéciaux.
    
   JSON_ERROR_UNSUPPORTED_TYPE
    (int)
   JSON_PARTIAL_OUTPUT_ON_ERROR a été fournie,
     null sera encodé à la place de la valeur non supportée.
    
   JSON_ERROR_INVALID_PROPERTY_NAME
    (int)
   JSON_ERROR_UTF16
    (int)
   Les constantes suivantes peuvent être combinées pour former les options de json_decode().
JSON_BIGINT_AS_STRING
    (int)
   JSON_OBJECT_AS_ARRAY
    (int)
   true.
    
   Les constantes suivantes peuvent être combinées pour former les options de json_encode().
JSON_HEX_TAG
    (int)
   JSON_HEX_AMP
    (int)
   JSON_HEX_APOS
    (int)
   JSON_HEX_QUOT
    (int)
   JSON_FORCE_OBJECT
    (int)
   JSON_NUMERIC_CHECK
    (int)
   JSON_PRETTY_PRINT
    (int)
   JSON_UNESCAPED_SLASHES
    (int)
   /.
    
   JSON_UNESCAPED_UNICODE
    (int)
   JSON_PARTIAL_OUTPUT_ON_ERROR
    (int)
   JSON_PRESERVE_ZERO_FRACTION
    (int)
  JSON_UNESCAPED_LINE_TERMINATORS
    (int)
   JSON_UNESCAPED_UNICODE est fourni. Il utilise le même
     comportement comme si c'était avant PHP 7.1 sans cette constante.
     Disponible à partir de PHP 7.1.0.
    
   Les constantes suivantes peuvent être combinées pour former les options de json_decode() et json_encode().
JSON_INVALID_UTF8_IGNORE
    (int)
   JSON_INVALID_UTF8_SUBSTITUTE
    (int)
   JSON_THROW_ON_ERROR
    (int)
   JSON_PARTIAL_OUTPUT_ON_ERROR prend la priorité par rapport à
     JSON_THROW_ON_ERROR.
     Disponible à partir de PHP 7.3.0.