Skip to content

Commit

Permalink
Added new constants to JSON constants.xml
Browse files Browse the repository at this point in the history
Added JSON_UNESCAPED_LINE_TERMINATORS, JSON_INVALID_UTF8_IGNORE, JSON_INVALID_UTF8_SUBSTITUTE and JSON_THROW_ON_ERROR.
  • Loading branch information
eusonlito authored and julionc committed Jul 11, 2024
1 parent 16ded52 commit 1f892dc
Showing 1 changed file with 64 additions and 1 deletion.
65 changes: 64 additions & 1 deletion reference/json/constants.xml
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,71 @@
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.json-unescaped-line-terminators">
<term>
<constant>JSON_UNESCAPED_LINE_TERMINATORS</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
La finalización de línea se mantienen sin escapar
cuando se indica <constant>JSON_UNESCAPED_UNICODE</constant>.
Utiliza el mismo comportamiento que tenía antes de PHP 7.1 sin
esta constante. Disponible desde PHP 7.1.0.
</simpara>
</listitem>
</varlistentry>
</variablelist>

<para>
Las siguientes constantes pueden combinarse para formar opciones para
<function>json_decode</function> y <function>json_encode</function>.
</para>

<variablelist>
<varlistentry xml:id="constant.json-invalid-utf8-ignore">
<term>
<constant>JSON_INVALID_UTF8_IGNORE</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
Ignorar caracteres UTF-8 inválidos.
Disponible desde PHP 7.2.0.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.json-invalid-utf8-substitute">
<term>
<constant>JSON_INVALID_UTF8_SUBSTITUTE</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
Convertir caracteres UTF-8 inválidos a \0xfffd
(Carácter Unicode 'CARÁCTER DE SUSTITUCIÓN')
Disponible desde PHP 7.2.0.
</simpara>
</listitem>
</varlistentry>
<varlistentry xml:id="constant.json-throw-on-error">
<term>
<constant>JSON_THROW_ON_ERROR</constant>
(<type>int</type>)
</term>
<listitem>
<simpara>
Lanza <classname>JsonException</classname> si ocurre un error en lugar de
establecer el estado global de error que se recupera con
<function>json_last_error</function> y <function>json_last_error_msg</function>.
<constant>JSON_PARTIAL_OUTPUT_ON_ERROR</constant> tiene prioridad sobre
<constant>JSON_THROW_ON_ERROR</constant>.
Disponible desde PHP 7.3.0.
</simpara>
</listitem>
</varlistentry>
</variablelist>

</appendix>

<!-- Keep this comment at the end of the file
Expand All @@ -312,4 +376,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

0 comments on commit 1f892dc

Please sign in to comment.