<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/book.json.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'es',
  ),
  'this' => 
  array (
    0 => 'json.constants.php',
    1 => 'Constantes predefinidas',
    2 => 'Constantes predefinidas',
  ),
  'up' => 
  array (
    0 => 'book.json.php',
    1 => 'JSON',
  ),
  'prev' => 
  array (
    0 => 'json.installation.php',
    1 => 'Instalaci&oacute;n',
  ),
  'next' => 
  array (
    0 => 'class.jsonexception.php',
    1 => 'JsonException',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'es',
    'path' => 'reference/json/constants.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="json.constants" class="appendix">
 <h1 class="title">Constantes predefinidas</h1>

 <p class="simpara">Estas constantes son definidas por esta
extensión, y solo están disponibles si esta extensión ha sido compilada con
PHP, o bien cargada en tiempo de ejecución.</p>
 <p class="para">
  Las constantes siguientes indican el tipo de error devuelto por
  <span class="function"><a href="function.json-last-error.php" class="function">json_last_error()</a></span> o almacenado como <var class="varname">code</var>
  de una <span class="classname"><a href="class.jsonexception.php" class="classname">JsonException</a></span>.
 </p>
 <dl>
  
   <dt id="constant.json-error-none">
    <strong><code><a href="json.constants.php#constant.json-error-none">JSON_ERROR_NONE</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     No se ha producido ningún error.
    </span>
   </dd>
  
  
   <dt id="constant.json-error-depth">
    <strong><code><a href="json.constants.php#constant.json-error-depth">JSON_ERROR_DEPTH</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Se ha alcanzado la profundidad máxima de la pila.
    </span>
   </dd>
  
  
   <dt id="constant.json-error-state-mismatch">
    <strong><code><a href="json.constants.php#constant.json-error-state-mismatch">JSON_ERROR_STATE_MISMATCH</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Ocurre con un underflow o con una inadaptación de los modos.
    </span>
   </dd>
  
  
   <dt id="constant.json-error-ctrl-char">
    <strong><code><a href="json.constants.php#constant.json-error-ctrl-char">JSON_ERROR_CTRL_CHAR</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Error al controlar los caracteres, probablemente codificados incorrectamente.
    </span>
   </dd>
  
  
   <dt id="constant.json-error-syntax">
    <strong><code><a href="json.constants.php#constant.json-error-syntax">JSON_ERROR_SYNTAX</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Error de sintaxis.
    </span>
   </dd>
  
  
   <dt id="constant.json-error-utf8">
    <strong><code><a href="json.constants.php#constant.json-error-utf8">JSON_ERROR_UTF8</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Caracteres UTF-8 mal formados, probablemente codificados incorrectamente.
    </span>
   </dd>
  
  
   <dt id="constant.json-error-recursion">
    <strong><code><a href="json.constants.php#constant.json-error-recursion">JSON_ERROR_RECURSION</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     El objeto o el array pasado a la función <span class="function"><a href="function.json-encode.php" class="function">json_encode()</a></span>
     incluye referencias recursivas y no pueden ser codificadas.
     Si se ha proporcionado la opción <strong><code><a href="json.constants.php#constant.json-partial-output-on-error">JSON_PARTIAL_OUTPUT_ON_ERROR</a></code></strong>,
     <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> será codificado en lugar de la referencia recursiva.
    </span>
   </dd>
  
  
   <dt id="constant.json-error-inf-or-nan">
    <strong><code><a href="json.constants.php#constant.json-error-inf-or-nan">JSON_ERROR_INF_OR_NAN</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     El valor pasado a la función <span class="function"><a href="function.json-encode.php" class="function">json_encode()</a></span> incluye
     <a href="language.types.float.php#language.types.float.nan" class="link"><strong><code><a href="math.constants.php#constant.nan">NAN</a></code></strong></a>,
     o <a href="function.is-infinite.php" class="link"><strong><code><a href="math.constants.php#constant.inf">INF</a></code></strong></a>.
     Si se ha proporcionado la opción <strong><code><a href="json.constants.php#constant.json-partial-output-on-error">JSON_PARTIAL_OUTPUT_ON_ERROR</a></code></strong>,
     <code class="literal">0</code> será codificado en lugar de estos números especiales.
    </span>
   </dd>
  
  
   <dt id="constant.json-error-unsupported-type">
    <strong><code><a href="json.constants.php#constant.json-error-unsupported-type">JSON_ERROR_UNSUPPORTED_TYPE</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Se ha proporcionado un valor de un tipo no soportado a la función
     <span class="function"><a href="function.json-encode.php" class="function">json_encode()</a></span>, como por ejemplo una <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>.
     Si se ha proporcionado la opción <strong><code><a href="json.constants.php#constant.json-partial-output-on-error">JSON_PARTIAL_OUTPUT_ON_ERROR</a></code></strong>,
     <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> será codificado en lugar del valor no soportado.
    </span>
   </dd>
  
  
   <dt id="constant.json-error-invalid-property-name">
    <strong><code><a href="json.constants.php#constant.json-error-invalid-property-name">JSON_ERROR_INVALID_PROPERTY_NAME</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Una clave que comienza con el carácter \u0000 estaba presente en la
     cadena de caracteres pasada a <span class="function"><a href="function.json-decode.php" class="function">json_decode()</a></span>
     durante la decodificación de un objeto JSON en un objeto PHP.
    </span>
   </dd>
  
  
   <dt id="constant.json-error-utf16">
    <strong><code><a href="json.constants.php#constant.json-error-utf16">JSON_ERROR_UTF16</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Sustituto UTF-16 simple no apareado en el escape unicode contenido
     en la cadena de caracteres JSON pasada a <span class="function"><a href="function.json-decode.php" class="function">json_decode()</a></span>.
    </span>
   </dd>
  
  
   <dt id="constant.json-error-non-backed-enum">
    <strong><code><a href="json.constants.php#constant.json-error-non-backed-enum">JSON_ERROR_NON_BACKED_ENUM</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     El valor pasado a <span class="function"><a href="function.json-encode.php" class="function">json_encode()</a></span>
     incluye una enumeración no soportada que no puede ser serializada.
     Disponible a partir de PHP 8.1.0.
    </span>
   </dd>
  
 </dl>

 <p class="para">
  Las constantes siguientes pueden ser combinadas para formar las opciones de
  <span class="function"><a href="function.json-decode.php" class="function">json_decode()</a></span>.
 </p>
 <dl>
  
   <dt id="constant.json-bigint-as-string">
    <strong><code><a href="json.constants.php#constant.json-bigint-as-string">JSON_BIGINT_AS_STRING</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Decodifica los enteros grandes como una cadena de caracteres.
    </span>
   </dd>
  
  
   <dt id="constant.json-object-as-array">
    <strong><code><a href="json.constants.php#constant.json-object-as-array">JSON_OBJECT_AS_ARRAY</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Decodifica un objeto JSON en array PHP. Esta opción puede ser añadida
     automáticamente llamando a <span class="function"><a href="function.json-decode.php" class="function">json_decode()</a></span> con el
     segundo argumento igual a <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>.
    </span>
   </dd>
  
 </dl>

 <p class="para">
  Las constantes siguientes pueden ser combinadas para formar las opciones de
  <span class="function"><a href="function.json-encode.php" class="function">json_encode()</a></span>.
 </p>
 <dl>
  
   <dt id="constant.json-hex-tag">
    <strong><code><a href="json.constants.php#constant.json-hex-tag">JSON_HEX_TAG</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Todos los caracteres &lt; y &gt; son convertidos en secuencias
     \u003C y \u003E.
    </span>
   </dd>
  
  
   <dt id="constant.json-hex-amp">
    <strong><code><a href="json.constants.php#constant.json-hex-amp">JSON_HEX_AMP</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Todos los caracteres &amp; son convertidos en \u0026.
    </span>
   </dd>
  
  
   <dt id="constant.json-hex-apos">
    <strong><code><a href="json.constants.php#constant.json-hex-apos">JSON_HEX_APOS</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Todos los apóstrofes &#039; son convertidos en \u0027.
    </span>
   </dd>
  
  
   <dt id="constant.json-hex-quot">
    <strong><code><a href="json.constants.php#constant.json-hex-quot">JSON_HEX_QUOT</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Todas las comillas dobles &quot; son convertidas en \u0022.
    </span>
   </dd>
  
  
   <dt id="constant.json-force-object">
    <strong><code><a href="json.constants.php#constant.json-force-object">JSON_FORCE_OBJECT</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Produce un objeto en lugar de un array, cuando se utiliza un array
     no asociativo. Esto es especialmente útil cuando el destinatario del resultado espera un objeto,
     y el array está vacío.
    </span>
   </dd>
  
  
   <dt id="constant.json-numeric-check">
    <strong><code><a href="json.constants.php#constant.json-numeric-check">JSON_NUMERIC_CHECK</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Codifica las cadenas numéricas como números.
    </span>
   </dd>
  
  
   <dt id="constant.json-pretty-print">
    <strong><code><a href="json.constants.php#constant.json-pretty-print">JSON_PRETTY_PRINT</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Utiliza espacios en los datos devueltos para
     formatearlos.
    </span>
   </dd>
  
  
   <dt id="constant.json-unescaped-slashes">
    <strong><code><a href="json.constants.php#constant.json-unescaped-slashes">JSON_UNESCAPED_SLASHES</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     No escapar los caracteres <code class="literal">/</code>.
    </span>
   </dd>
  
  
   <dt id="constant.json-unescaped-unicode">
    <strong><code><a href="json.constants.php#constant.json-unescaped-unicode">JSON_UNESCAPED_UNICODE</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Codifica los caracteres multioctetos Unicode literalmente (el comportamiento
     por defecto es escaparles con \uXXXX).
    </span>
   </dd>
  
  
   <dt id="constant.json-partial-output-on-error">
    <strong><code><a href="json.constants.php#constant.json-partial-output-on-error">JSON_PARTIAL_OUTPUT_ON_ERROR</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Sustituye ciertos valores no codificables en lugar de fallar.
    </span>
   </dd>
  
  
   <dt id="constant.json-preserve-zero-fraction">
    <strong><code><a href="json.constants.php#constant.json-preserve-zero-fraction">JSON_PRESERVE_ZERO_FRACTION</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
  </dt>
  <dd>
   <span class="simpara">
    Asegura que los valores de tipo <span class="type"><a href="language.types.float.php" class="type float">float</a></span> siempre sean codificados como
    valor flotante.
   </span>
  </dd>
  
  
   <dt id="constant.json-unescaped-line-terminators">
    <strong><code><a href="json.constants.php#constant.json-unescaped-line-terminators">JSON_UNESCAPED_LINE_TERMINATORS</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Los terminadores de línea son conservados sin escapar cuando
     <strong><code><a href="json.constants.php#constant.json-unescaped-unicode">JSON_UNESCAPED_UNICODE</a></code></strong> es proporcionado. Utiliza el mismo
     comportamiento como si fuera antes de PHP 7.1 sin esta constante.
     Disponible a partir de PHP 7.1.0.
    </span>
   </dd>
  
 </dl>

 <p class="para">
  Las constantes siguientes pueden ser combinadas para formar las opciones de
  <span class="function"><a href="function.json-decode.php" class="function">json_decode()</a></span> y <span class="function"><a href="function.json-encode.php" class="function">json_encode()</a></span>.
 </p>
 <dl>
  
   <dt id="constant.json-invalid-utf8-ignore">
    <strong><code><a href="json.constants.php#constant.json-invalid-utf8-ignore">JSON_INVALID_UTF8_IGNORE</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Ignora los caracteres UTF-8 inválidos.
     Disponible a partir de PHP 7.2.0.
    </span>
   </dd>
  
  
   <dt id="constant.json-invalid-utf8-substitute">
    <strong><code><a href="json.constants.php#constant.json-invalid-utf8-substitute">JSON_INVALID_UTF8_SUBSTITUTE</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Convierte los caracteres UTF-8 inválidos en \0xfffd
     (Carácter Unicode &#039;REPLACEMENT CHARACTER&#039;).
     Disponible a partir de PHP 7.2.0.
    </span>
   </dd>
  
  
   <dt id="constant.json-throw-on-error">
    <strong><code><a href="json.constants.php#constant.json-throw-on-error">JSON_THROW_ON_ERROR</a></code></strong>
    (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>)
   </dt>
   <dd>
    <span class="simpara">
     Emite una <span class="classname"><a href="class.jsonexception.php" class="classname">JsonException</a></span> si ocurre un error
     en lugar de establecer el estado de error global que es recuperado mediante
     <span class="function"><a href="function.json-last-error.php" class="function">json_last_error()</a></span> y <span class="function"><a href="function.json-last-error-msg.php" class="function">json_last_error_msg()</a></span>.
     <strong><code><a href="json.constants.php#constant.json-partial-output-on-error">JSON_PARTIAL_OUTPUT_ON_ERROR</a></code></strong> tiene prioridad sobre
     <strong><code><a href="json.constants.php#constant.json-throw-on-error">JSON_THROW_ON_ERROR</a></code></strong>.
     Disponible a partir de PHP 7.3.0.
    </span>
   </dd>
  
 </dl>

</div>
<?php manual_footer($setup); ?>