svn: /phpdoc/fr/trunk/reference/json/ constants.xml functions/json-last-error-msg.xml functions/json-last-error.xml

From: Date: Sun, 12 May 2019 16:48:16 +0000
Subject: svn: /phpdoc/fr/trunk/reference/json/ constants.xml functions/json-last-error-msg.xml functions/json-last-error.xml
Groups: php.doc.fr 
Request: Send a blank email to doc-fr+get-12937@lists.php.net to get a copy of this message
girgias Sun, 12 May 2019 16:48:16 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=347414 Log: Sync with latest EN revision. JSON Behaviour clarification. Changed paths: U phpdoc/fr/trunk/reference/json/constants.xml U phpdoc/fr/trunk/reference/json/functions/json-last-error-msg.xml U phpdoc/fr/trunk/reference/json/functions/json-last-error.xml Modified: phpdoc/fr/trunk/reference/json/constants.xml =================================================================== --- phpdoc/fr/trunk/reference/json/constants.xml 2019-05-11 21:34:32 UTC (rev 347413) +++ phpdoc/fr/trunk/reference/json/constants.xml 2019-05-12 16:48:16 UTC (rev 347414) @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <!-- $Revision$ --> -<!-- EN-Revision: 347249 Maintainer: girgias Status: ready --> +<!-- EN-Revision: 347407 Maintainer: girgias Status: ready --> <!-- Reviewed: no --> <appendix xml:id="json.constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> @@ -390,7 +390,7 @@ <simpara> Émet une <classname>JsonException</classname> si une erreur se produit au lieu de régler l'état d'erreur globale qui est récupérer grâce à - <function>json_last_error</function>. + <function>json_last_error</function> et <function>json_last_error_msg</function>. <constant>JSON_PARTIAL_OUTPUT_ON_ERROR</constant> prend la priorité par rapport à <constant>JSON_THROW_ON_ERROR</constant>. Disponible à partir de PHP 7.3.0. Modified: phpdoc/fr/trunk/reference/json/functions/json-last-error-msg.xml =================================================================== --- phpdoc/fr/trunk/reference/json/functions/json-last-error-msg.xml 2019-05-11 21:34:32 UTC (rev 347413) +++ phpdoc/fr/trunk/reference/json/functions/json-last-error-msg.xml 2019-05-12 16:48:16 UTC (rev 347414) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!-- $Revision$ --> -<!-- EN-Revision: 343770 Maintainer: yannick Status: ready --> -<!-- Reviewed: yes --> +<!-- EN-Revision: 347407 Maintainer: girgias Status: ready --> +<!-- Reviewed: no --> <refentry xml:id="function.json-last-error-msg" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> @@ -16,7 +16,9 @@ <void /> </methodsynopsis> <para> - + Retourne la chaîne d'erreur du dernier appel à <function>json_encode</function> + ou <function>json_decode</function>, qui n'a pas spécifié + <constant>JSON_THROW_ON_ERROR</constant>. </para> </refsect1> Modified: phpdoc/fr/trunk/reference/json/functions/json-last-error.xml =================================================================== --- phpdoc/fr/trunk/reference/json/functions/json-last-error.xml 2019-05-11 21:34:32 UTC (rev 347413) +++ phpdoc/fr/trunk/reference/json/functions/json-last-error.xml 2019-05-12 16:48:16 UTC (rev 347414) @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <!-- $Revision$ --> -<!-- EN-Revision: 341024 Maintainer: yannick Status: ready --> -<!-- Reviewed: yes --> +<!-- EN-Revision: 347407 Maintainer: girgias Status: ready --> +<!-- Reviewed: no --> <refentry xml:id="function.json-last-error" xmlns="http://docbook.org/ns/docbook"> <refnamediv> @@ -16,9 +16,9 @@ <void /> </methodsynopsis> <para> - <function>json_last_error</function> retourne la - dernière erreur, s'il y en a eu, survenue lors - de la dernière opération d'encodage/décodage JSON. + Retourne la dernière erreur, s'il y en a eu, survenue lors de la dernière + opération d'encodage/décodage JSON, qui n'a pas spécifié + <constant>JSON_THROW_ON_ERROR</constant>. </para> </refsect1> @@ -168,7 +168,7 @@ </para> <para> <example> - <title>Exemple avec <function>json_last_error</function> et <function>json_encode</function></title> + <title><function>json_last_error</function> avec <function>json_encode</function></title> <programlisting role="php"> <![CDATA[ <?php @@ -191,6 +191,31 @@ </screen> </example> </para> + <para> + <example> + <title><function>json_last_error</function> et <constant>JSON_THROW_ON_ERROR</constant></title> + <programlisting role="php"> +<![CDATA[ +<?php +// Une séquence UTF8 invalide qui cause JSON_ERROR_UTF8 +json_encode("\xB1\x31"); + +// Ceci ne produit pas une erreur JSON +json_encode('okay', JSON_THROW_ON_ERROR); + +// L'état d'erreur global n'a pas été modifié par le json_encode() ci-dessus +var_dump(json_last_error() === JSON_ERROR_UTF8); +?> +]]> + </programlisting> + &example.outputs; + <screen> +<![CDATA[ +bool(true) +]]> + </screen> + </example> + </para> </refsect1> <refsect1 role="seealso">

« previous php.doc.fr (#12937) next »