com doc/es: Fix #73579[ES] Wrong example #2 initialization: reference/json/functions/json-encode.xml
| From: | Julio Napurí Carlos | Date: | Wed, 03 Feb 2021 17:17:55 +0000 |
| Subject: | com doc/es: Fix #73579[ES] Wrong example #2 initialization: reference/json/functions/json-encode.xml | ||
| Groups: | php.doc.es | ||
| Request: | Send a blank email to doc-es+get-11016@lists.php.net to get a copy of this message | ||
Commit: 159b2eda5b96bf41ffe9b24ecb97ec0aaa552933
Author: Julio Napurí <julionc@php.net> Wed, 3 Feb 2021 12:17:55 -0500
Parents: 944fe3c23003c6d4c7ea3d7b06cda5c972069910
Branches: master
Link: http://git.php.net/?p=doc/es.git;a=commitdiff;h=159b2eda5b96bf41ffe9b24ecb97ec0aaa552933
Log:
Fix #73579[ES] Wrong example #2 initialization
Bugs:
https://bugs.php.net/73579
https://bugs.php.net/2
Changed paths:
M reference/json/functions/json-encode.xml
Diff:
diff --git a/reference/json/functions/json-encode.xml b/reference/json/functions/json-encode.xml
index 2651babfa5..3362950a22 100644
--- a/reference/json/functions/json-encode.xml
+++ b/reference/json/functions/json-encode.xml
@@ -1,27 +1,32 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
-<!-- EN-Revision: f9254e756882a011921138392fa240189dcc3a8c Maintainer: seros Status: ready
-->
-<!-- Reviewed: no Maintainer: andresdzphp -->
+<!-- EN-Revision: 9e3b30232be09c56bd18a766b2041da254ef95f0 Maintainer: seros Status: ready
-->
+<!-- Reviewed: yes Maintainer: julionc -->
<refentry xml:id="function.json-encode" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>json_encode</refname>
<refpurpose>Retorna la representación JSON del valor dado</refpurpose>
</refnamediv>
-
- <refsect1 role="description">
+
+ <refsect1 role="description">
&reftitle.description;
<methodsynopsis>
- <type>string</type><methodname>json_encode</methodname>
+ <type
class="union"><type>string</type><type>false</type></type><methodname>json_encode</methodname>
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
- <methodparam
choice="opt"><type>int</type><parameter>options</parameter><initializer>0</initializer></methodparam>
+ <methodparam
choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam>
<methodparam
choice="opt"><type>int</type><parameter>depth</parameter><initializer>512</initializer></methodparam>
</methodsynopsis>
<para>
Devuelve un string con la representación JSON de
<parameter>value</parameter>.
</para>
+ <para>
+ La codificación se ve afectada por los <parameter>flags</parameter> suministrados
+ y además la codificación de los valores de tipo float dependen del valor de
+ <link linkend="ini.serialize-precision">serialize_precision</link>.
+ </para>
</refsect1>
-
+
<refsect1 role="parameters">
&reftitle.parameters;
<para>
@@ -40,20 +45,26 @@
</listitem>
</varlistentry>
<varlistentry>
- <term><parameter>options</parameter></term>
+ <term><parameter>flags</parameter></term>
<listitem>
<para>
- Máscara de bits que compuesta por <constant>JSON_HEX_QUOT</constant>,
+ Máscara de bits que compuesta por
+ <constant>JSON_FORCE_OBJECT</constant>,
+ <constant>JSON_HEX_QUOT</constant>,
<constant>JSON_HEX_TAG</constant>,
<constant>JSON_HEX_AMP</constant>,
<constant>JSON_HEX_APOS</constant>,
+ <constant>JSON_INVALID_UTF8_IGNORE</constant>,
+ <constant>JSON_INVALID_UTF8_SUBSTITUTE</constant>,
<constant>JSON_NUMERIC_CHECK</constant>,
+ <constant>JSON_PARTIAL_OUTPUT_ON_ERROR</constant>,
+ <constant>JSON_PRESERVE_ZERO_FRACTION</constant>,
<constant>JSON_PRETTY_PRINT</constant>,
+ <constant>JSON_UNESCAPED_LINE_TERMINATORS</constant>,
<constant>JSON_UNESCAPED_SLASHES</constant>,
- <constant>JSON_FORCE_OBJECT</constant>,
- <constant>JSON_PRESERVE_ZERO_FRACTION</constant>,
<constant>JSON_UNESCAPED_UNICODE</constant>,
- <constant>JSON_PARTIAL_OUTPUT_ON_ERROR</constant>. El comportamiento de estas
+ <constant>JSON_THROW_ON_ERROR</constant>.
+ El comportamiento de estas
constantes se describe en la página de
<link linkend="json.constants">constantes de JSON</link>.
</para>
@@ -70,14 +81,14 @@
</variablelist>
</para>
</refsect1>
-
+
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Devuelve un <type>string</type> JSON codificado en caso de éxito
&return.falseforfailure;.
</para>
</refsect1>
-
+
<refsect1 role="changelog">
&reftitle.changelog;
<para>
@@ -91,33 +102,33 @@
</thead>
<tbody>
<row>
- <entry>5.6.6</entry>
+ <entry>7.3.0</entry>
<entry>
- Se añadió la opción <constant>JSON_PRESERVE_ZERO_FRACTION</constant> del
parámetro <parameter>option</parameter>.
+ <constant>JSON_THROW_ON_ERROR</constant>
+ Se añadió a <parameter>flags</parameter>.
</entry>
</row>
<row>
- <entry>5.5.0</entry>
+ <entry>7.2.0</entry>
<entry>
- Se añadió el parámetro <parameter>depth</parameter>.
+ <constant>JSON_INVALID_UTF8_IGNORE</constant>, and
+ <constant>JSON_INVALID_UTF8_SUBSTITUTE</constant>
+ Se añadieron a <parameter>flags</parameter>.
</entry>
</row>
<row>
- <entry>5.4.0</entry>
+ <entry>7.1.0</entry>
<entry>
- Se añadió al parámetro <parameter>options</parameter> las constantes
<constant>JSON_PRETTY_PRINT</constant>,
<constant>JSON_UNESCAPED_SLASHES</constant>, y
<constant>JSON_UNESCAPED_UNICODE</constant>.
+ <constant>JSON_UNESCAPED_LINE_TERMINATORS</constant>
+ Se añadió a <parameter>flags</parameter>.
</entry>
</row>
<row>
- <entry>5.3.3</entry>
+ <entry>7.1.0</entry>
<entry>
- Se añadió al parámetro <parameter>option</parameter> la constante
<constant>JSON_NUMERIC_CHECK</constant>.
- </entry>
- </row>
- <row>
- <entry>5.3.0</entry>
- <entry>
- Se añadió el parámetro <parameter>options</parameter>.
+ <link linkend="ini.serialize-precision">serialize_precision</link> se
+ utiliza en lugar de <link linkend="ini.precision">precision</link> al
+ codificar 'doubles'.
</entry>
</row>
</tbody>
@@ -125,7 +136,7 @@
</informaltable>
</para>
</refsect1>
-
+
<refsect1 role="examples">
&reftitle.examples;
<para>
@@ -147,7 +158,7 @@ echo json_encode($arr);
]]>
</screen>
</example>
-
+
<example>
<title>
Un ejemplo de <function>json_encode</function> mostrando algunas de las opciones
en acción
@@ -155,7 +166,7 @@ echo json_encode($arr);
<programlisting role="php">
<![CDATA[
<?php
-$a =
array('<foo>',"'bar'",'"baz"','&blong&');
+$a =
array('<foo>',"'bar'",'"baz"','&blong&',
"\xc3\xa9");
echo "Normal: ", json_encode($a), "\n";
echo "Tags: ", json_encode($a, JSON_HEX_TAG), "\n";
@@ -341,7 +352,7 @@ string(2) "12"
</example>
</para>
</refsect1>
-
+
<refsect1 role="notes">
&reftitle.notes;
<note>
@@ -373,7 +384,7 @@ string(2) "12"
</para>
</note>
</refsect1>
-
+
<refsect1 role="seealso">
&reftitle.seealso;
<para>
@@ -386,7 +397,6 @@ string(2) "12"
</para>
</refsect1>
</refentry>
-
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml