[DOC-CVS] [doc-en] master: json-last-error.xml Move `Available as of` to *Availability* column t… (#5447)
[email protected] (Mikhail Alferov via GitHub)
| Newsgroups | php.doc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: Mikhail Alferov (mmalferov) Committer: GitHub (web-flow) Pusher: lacatoire Date: 2026-08-27T10:21:00+02:00 Commit: https://github.com/php/doc-en/commit/3733e082ad183251e0b63d08b52c448a243f9710 Raw diff: https://github.com/php/doc-en/commit/3733e082ad183251e0b63d08b52c448a243f9710.diff json-last-error.xml Move `Available as of` to *Availability* column t… (#5447) * json-last-error.xml Move `Available as of` to *Availability* column to consistency * Update reference/json/functions/json-last-error.xml Co-authored-by: Louis-Arnaud <[email protected]> * Apply suggestions from code review Co-authored-by: Louis-Arnaud <[email protected]> * Convert JSON error codes table to variablelist * Wrap variablelist in para * Fix para -> simpara --------- Co-authored-by: Louis-Arnaud <[email protected]> Changed paths: M reference/json/functions/json-last-error.xml Diff: diff --git a/reference/json/functions/json-last-error.xml b/reference/json/functions/json-last-error.xml index ead9a9fb2ae4..d5d012fdf3f6 100644 --- a/reference/json/functions/json-last-error.xml +++ b/reference/json/functions/json-last-error.xml @@ -25,89 +25,113 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; + <simpara> + Returns an integer, the value can be one of the following + constants: + </simpara> <para> - Returns an integer, the value can be one of the following - constants: + <variablelist> + <varlistentry> + <term><constant>JSON_ERROR_NONE</constant></term> + <listitem> + <simpara>No error has occurred</simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><constant>JSON_ERROR_DEPTH</constant></term> + <listitem> + <simpara>The maximum stack depth has been exceeded</simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><constant>JSON_ERROR_STATE_MISMATCH</constant></term> + <listitem> + <simpara>Invalid or malformed JSON</simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><constant>JSON_ERROR_CTRL_CHAR</constant></term> + <listitem> + <simpara>Control character error, possibly incorrectly encoded</simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><constant>JSON_ERROR_SYNTAX</constant></term> + <listitem> + <simpara>Syntax error</simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><constant>JSON_ERROR_UTF8</constant></term> + <listitem> + <simpara>Malformed UTF-8 characters, possibly incorrectly encoded</simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><constant>JSON_ERROR_RECURSION</constant></term> + <listitem> + <simpara>One or more recursive references in the value to be encoded</simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><constant>JSON_ERROR_INF_OR_NAN</constant></term> + <listitem> + <simpara> + One or more + <link linkend="language.types.float.nan"><constant>NAN</constant></link> + or <link linkend="function.is-infinite"><constant>INF</constant></link> + values in the value to be encoded + </simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><constant>JSON_ERROR_UNSUPPORTED_TYPE</constant></term> + <listitem> + <simpara>A value of a type that cannot be encoded was given</simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><constant>JSON_ERROR_INVALID_PROPERTY_NAME</constant></term> + <listitem> + <simpara>A property name that cannot be encoded was given</simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><constant>JSON_ERROR_UTF16</constant></term> + <listitem> + <simpara>Malformed UTF-16 characters, possibly incorrectly encoded</simpara> + </listitem> + </varlistentry> + <varlistentry> + <term><constant>JSON_ERROR_NON_BACKED_ENUM</constant></term> + <listitem> + <simpara>Value contains a non-backed enum which cannot be serialized</simpara> + </listitem> + </varlistentry> + </variablelist> </para> - <table> - <title>JSON error codes</title> + </refsect1> + + <refsect1 role="changelog"> + &reftitle.changelog; + <informaltable> <tgroup cols="2"> <thead> <row> - <entry>Constant</entry> - <entry>Meaning</entry> - <entry>Availability</entry> + <entry>&Version;</entry> + <entry>&Description;</entry> </row> </thead> <tbody> <row> - <entry><constant>JSON_ERROR_NONE</constant></entry> - <entry>No error has occurred</entry> - <entry></entry> - </row> - <row> - <entry><constant>JSON_ERROR_DEPTH</constant></entry> - <entry>The maximum stack depth has been exceeded</entry> - <entry></entry> - </row> - <row> - <entry><constant>JSON_ERROR_STATE_MISMATCH</constant></entry> - <entry>Invalid or malformed JSON</entry> - <entry></entry> - </row> - <row> - <entry><constant>JSON_ERROR_CTRL_CHAR</constant></entry> - <entry>Control character error, possibly incorrectly encoded</entry> - <entry></entry> - </row> - <row> - <entry><constant>JSON_ERROR_SYNTAX</constant></entry> - <entry>Syntax error</entry> - <entry></entry> - </row> - <row> - <entry><constant>JSON_ERROR_UTF8</constant></entry> - <entry>Malformed UTF-8 characters, possibly incorrectly encoded</entry> - <entry></entry> - </row> - <row> - <entry><constant>JSON_ERROR_RECURSION</constant></entry> - <entry>One or more recursive references in the value to be encoded</entry> - <entry></entry> - </row> - <row> - <entry><constant>JSON_ERROR_INF_OR_NAN</constant></entry> + <entry>8.1.0</entry> <entry> - One or more - <link linkend="language.types.float.nan"><constant>NAN</constant></link> - or <link linkend="function.is-infinite"><constant>INF</constant></link> - values in the value to be encoded + <constant>JSON_ERROR_NON_BACKED_ENUM</constant> was added. </entry> - <entry></entry> - </row> - <row> - <entry><constant>JSON_ERROR_UNSUPPORTED_TYPE</constant></entry> - <entry>A value of a type that cannot be encoded was given</entry> - <entry></entry> - </row> - <row> - <entry><constant>JSON_ERROR_INVALID_PROPERTY_NAME</constant></entry> - <entry>A property name that cannot be encoded was given</entry> - <entry></entry> - </row> - <row> - <entry><constant>JSON_ERROR_UTF16</constant></entry> - <entry>Malformed UTF-16 characters, possibly incorrectly encoded</entry> - <entry></entry> - </row> - <row> - <entry><constant>JSON_ERROR_NON_BACKED_ENUM</constant></entry> - <entry>Value contains a non-backed enum which cannot be serialized. Available as of PHP 8.1.0.</entry> - <entry></entry> </row> </tbody> </tgroup> - </table> + </informaltable> </refsect1> <refsect1 role="examples">