mirror of
https://github.com/php/doc-de.git
synced 2026-03-24 07:12:15 +01:00
408 lines
12 KiB
XML
408 lines
12 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: 40e4bf862f9c23ffe871a68baebf31f753d4293b Maintainer: sammywg Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
<appendix xml:id="json.constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
&reftitle.constants;
|
|
&extension.constants;
|
|
<para>
|
|
Die folgenden Konstanten geben den Typ des Fehlers an, der von
|
|
<function>json_last_error</function> zurückgegeben, oder der als <varname>code</varname>
|
|
einer <classname>JsonException</classname> gespeichert wurde.
|
|
</para>
|
|
<variablelist>
|
|
<varlistentry xml:id="constant.json-error-none">
|
|
<term>
|
|
<constant>JSON_ERROR_NONE</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Kein Fehler aufgetreten.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-error-depth">
|
|
<term>
|
|
<constant>JSON_ERROR_DEPTH</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Die maximale Stacktiefe wurde überschritten.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-error-state-mismatch">
|
|
<term>
|
|
<constant>JSON_ERROR_STATE_MISMATCH</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Tritt ein bei Unterlauf oder State-Mismatch.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-error-ctrl-char">
|
|
<term>
|
|
<constant>JSON_ERROR_CTRL_CHAR</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Steuerzeichenfehler, möglicherweise unkorrekt kodiert.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-error-syntax">
|
|
<term>
|
|
<constant>JSON_ERROR_SYNTAX</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Syntaxfehler.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-error-utf8">
|
|
<term>
|
|
<constant>JSON_ERROR_UTF8</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Ungültige UTF-8 Zeichen, eventuall falsch kodiert.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-error-recursion">
|
|
<term>
|
|
<constant>JSON_ERROR_RECURSION</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Das an <function>json_encode</function> übergebene Objekt oder Array
|
|
enthält rekursive Referenzen und kann nicht kodiert werden. Wenn
|
|
die <constant>JSON_PARTIAL_OUTPUT_ON_ERROR</constant> Option übergeben
|
|
wurde, wird &null; an Stelle der rekursiven Referenz kodiert.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-error-inf-or-nan">
|
|
<term>
|
|
<constant>JSON_ERROR_INF_OR_NAN</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Der an <function>json_encode</function> übergebene Wert enthält entweder
|
|
<link linkend="language.types.float.nan"><constant>NAN</constant></link>
|
|
oder <link linkend="function.is-infinite"><constant>INF</constant></link>.
|
|
Wenn die <constant>JSON_PARTIAL_OUTPUT_ON_ERROR</constant> Option übergeben
|
|
wurde, wird <literal>0</literal> an Stelle dieser speziellen Zahlen kodiert.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-error-unsupported-type">
|
|
<term>
|
|
<constant>JSON_ERROR_UNSUPPORTED_TYPE</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Der an <function>json_encode</function> übergebene Wert enthält einen
|
|
nicht unterstützten Typ, beispielweise &resource;.
|
|
Wenn die <constant>JSON_PARTIAL_OUTPUT_ON_ERROR</constant> Option übergeben
|
|
wurde, wird &null; an Stelle des nicht unterstützten Wertes kodiert.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-error-invalid-property-name">
|
|
<term>
|
|
<constant>JSON_ERROR_INVALID_PROPERTY_NAME</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Ein Schlüssel beginnend mit einem \u0000 Zeichen war in der Zeichenkette
|
|
enthalten, die an <function>json_decode</function> übergeben wurde, wenn
|
|
ein JSON-Objekt in ein PHP-Objekt konvertiert werden sollte.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-error-utf16">
|
|
<term>
|
|
<constant>JSON_ERROR_UTF16</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Ein einzelnes, alleinstehendes UTF-16-Surrogat war im JSON-String enthalten, der an
|
|
<function>json_decode</function> übergeben wurde.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-error-non-backed-enum">
|
|
<term>
|
|
<constant>JSON_ERROR_NON_BACKED_ENUM</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Der Wert, der an <function>json_encode</function> übergeben wird, enthält
|
|
eine nicht-wertgebundene (non-backed) Enum, die nicht serialisiert werden
|
|
kann. Verfügbar von PHP 8.1.0 an.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
|
|
<para>
|
|
Die folgenden Konstanten können kombiniert (verodert) werden,
|
|
um Optionen für <function>json_decode</function> zu bilden.
|
|
</para>
|
|
<variablelist>
|
|
<varlistentry xml:id="constant.json-bigint-as-string">
|
|
<term>
|
|
<constant>JSON_BIGINT_AS_STRING</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Dekodiert große Zahlen als ihre originale Zeichenkette.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-object-as-array">
|
|
<term>
|
|
<constant>JSON_OBJECT_AS_ARRAY</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Dekodiert JSON-Objekte als PHP-Arrays. Diese Option kann automatisch
|
|
angefügt werden, indem <function>json_decode</function> mit &true; als
|
|
zweitem Parameter aufgerufen wird.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
<para>
|
|
Die folgenden Konstanten können kombiniert (verodert) werden,
|
|
um Optionen für <function>json_encode</function> zu bilden.
|
|
</para>
|
|
<variablelist>
|
|
<varlistentry xml:id="constant.json-hex-tag">
|
|
<term>
|
|
<constant>JSON_HEX_TAG</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Alle < und > werden zu \u003C und \u003E konvertiert.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-hex-amp">
|
|
<term>
|
|
<constant>JSON_HEX_AMP</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Alle &s werden zu \u0026 konvertiert.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-hex-apos">
|
|
<term>
|
|
<constant>JSON_HEX_APOS</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Alle ' werden zu \u0027 konvertiert.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-hex-quot">
|
|
<term>
|
|
<constant>JSON_HEX_QUOT</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Alle " werden zu \u0022 konvertiert.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-force-object">
|
|
<term>
|
|
<constant>JSON_FORCE_OBJECT</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Gibt ein Objekt statt einem Array aus, wenn ein nichtassoziatives
|
|
Array verwendet wird. Besonders nützlich, wenn der Empfänger der Ausgabe
|
|
ein Objekt erwartet und das Array leer ist.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-numeric-check">
|
|
<term>
|
|
<constant>JSON_NUMERIC_CHECK</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Kodiert numerische Zeichenketten als Zahlen.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-pretty-print">
|
|
<term>
|
|
<constant>JSON_PRETTY_PRINT</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Nutzt Whitespace um die zurückgegebenen Daten zu formatieren.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-unescaped-slashes">
|
|
<term>
|
|
<constant>JSON_UNESCAPED_SLASHES</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Escape <literal>/</literal> nicht.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-unescaped-unicode">
|
|
<term>
|
|
<constant>JSON_UNESCAPED_UNICODE</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Kodiere Unicode Zeichen, welche aus mehreren Bytes bestehen, direkt
|
|
(standardmäßig werden \uXXXX Escapes genutzt).
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-partial-output-on-error">
|
|
<term>
|
|
<constant>JSON_PARTIAL_OUTPUT_ON_ERROR</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Ersetze einige unkodierbare Werte anstatt fehlzuschlagen.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-preserve-zero-fraction">
|
|
<term>
|
|
<constant>JSON_PRESERVE_ZERO_FRACTION</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Stellt sicher, dass &float; Werte immer als Fließkomma-Werte
|
|
kodiert werden.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-unescaped-line-terminators">
|
|
<term>
|
|
<constant>JSON_UNESCAPED_LINE_TERMINATORS</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Die Zeilentrenner bleiben unmaskiert, wenn
|
|
<constant>JSON_UNESCAPED_UNICODE</constant> übergeben wird. Das ist das
|
|
gleiche Verhalten wie vor PHP 7.1 ohne diese Konstante.
|
|
Verfügbar von PHP 7.1.0 an.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
|
|
<para>
|
|
Die folgenden Konstanten können kombiniert (verodert) werden, um Optionen für
|
|
<function>json_decode</function> und <function>json_encode</function> zu
|
|
bilden.
|
|
</para>
|
|
<variablelist>
|
|
<varlistentry xml:id="constant.json-invalid-utf8-ignore">
|
|
<term>
|
|
<constant>JSON_INVALID_UTF8_IGNORE</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Ignoriert ungültige UTF-8 Zeichen.
|
|
Verfügbar von PHP 7.2.0 an.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-invalid-utf8-substitute">
|
|
<term>
|
|
<constant>JSON_INVALID_UTF8_SUBSTITUTE</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Konvertiert ungültige UTF-8 Zeichen in \0xfffd
|
|
(Unicode Zeichen 'REPLACEMENT CHARACTER')
|
|
Verfügbar von PHP 7.2.0 an.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry xml:id="constant.json-throw-on-error">
|
|
<term>
|
|
<constant>JSON_THROW_ON_ERROR</constant>
|
|
(<type>int</type>)
|
|
</term>
|
|
<listitem>
|
|
<simpara>
|
|
Wirft im Fehlerfall eine <classname>JsonException</classname> anstatt den
|
|
globalen Fehlerstatus zu setzen, der mit <function>json_last_error</function>
|
|
und <function>json_last_error_msg</function>
|
|
abgerufen werden kann.
|
|
<constant>JSON_PARTIAL_OUTPUT_ON_ERROR</constant> hat Vorrang vor
|
|
<constant>JSON_THROW_ON_ERROR</constant>. Verfügbar von PHP 7.3.0 an.
|
|
</simpara>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
|
|
</appendix>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|