From 24e4bc70a6881013f0a2b066d2dfa420f39e2501 Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Sun, 20 Nov 2016 21:05:36 +0000 Subject: [PATCH] Fix, improve and add missing JSON constants git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@341082 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/json/constants.xml | 125 ++++++++++++++++++++++------------- 1 file changed, 78 insertions(+), 47 deletions(-) diff --git a/reference/json/constants.xml b/reference/json/constants.xml index c05f96c032..ae7f83a924 100644 --- a/reference/json/constants.xml +++ b/reference/json/constants.xml @@ -76,8 +76,8 @@ - Malformed UTF-8 characters, possibly incorrectly encoded. This - constant is available as of PHP 5.3.3. + Malformed UTF-8 characters, possibly incorrectly encoded. + Available since PHP 5.3.3. @@ -87,15 +87,13 @@ (integer) - + The object or array passed to json_encode include recursive references and cannot be encoded. If the JSON_PARTIAL_OUTPUT_ON_ERROR option was given, &null; will be encoded in the place of the recursive reference. - - - This constant is available as of PHP 5.5.0. - + Available since PHP 5.5.0. + @@ -104,17 +102,15 @@ (integer) - + The value passed to json_encode includes either NAN or INF. If the JSON_PARTIAL_OUTPUT_ON_ERROR option was given, 0 will be encoded in the place of these special numbers. - - - This constant is available as of PHP 5.5.0. - + Available since PHP 5.5.0. + @@ -123,43 +119,73 @@ (integer) - + A value of an unsupported type was given to json_encode, such as a resource. If the JSON_PARTIAL_OUTPUT_ON_ERROR option was given, &null; will be encoded in the place of the unsupported value. - - - This constant is available as of PHP 5.5.0. - + Available since PHP 5.5.0. + JSON_ERROR_INVALID_PROPERTY_NAME - (integer) + (integer) - - An invalid property name was given to json_decode. - - - This constant is available as of PHP 7.0.0. - + + A key starting with \u0000 character was in the string passed to + json_decode when decoding a JSON object into a PHP + object. + Available since PHP 7.0.0. + - JSON_ERROR_UTF16 - (integer) + JSON_ERROR_INVALID_PROPERTY_NAME + (integer) - - Invalid UTF-16 was given to json_decode. - - - This constant is available as of PHP 7.0.0. - + + Single unpaired UTF-16 surrogate in unicode escape contained in the + JSON string passed to json_encode. + Available since PHP 7.0.0. + + + + + + + The following constants can be combined to form options for + json_decode. + + + + + JSON_BIGINT_AS_STRING + (integer) + + + + Decodes large integers as their original string value. + Available since PHP 5.4.0. + + + + + + JSON_OBJECT_AS_ARRAY + (integer) + + + + Decodes JSON objects as PHP array. This option can be added automatically + by calling json_decode with the second parameter + equal to &true;. + Available since PHP 5.4.0. + @@ -243,18 +269,6 @@ - - - JSON_BIGINT_AS_STRING - (integer) - - - - Encodes large integers as their original string value. - Available since PHP 5.4.0. - - - JSON_PRETTY_PRINT @@ -286,7 +300,8 @@ - Encode multibyte Unicode characters literally (default is to escape as \uXXXX). + Encode multibyte Unicode characters literally (default is to escape as + \uXXXX). Available since PHP 5.4.0. @@ -303,19 +318,35 @@ - + JSON_PRESERVE_ZERO_FRACTION (integer) - Ensures that float values are always encoded as a float value. + Ensures that float values are always encoded as a float + value. Available since PHP 5.6.6. + + + JSON_UNESCAPED_LINE_TERMINATORS + (integer) + + + + The line terminators are kept unescaped when + JSON_UNESCAPED_UNICODE is supplied. It uses the same + behaviour as it was before PHP 7.1 without this constant. + Available since PHP 7.1.0. + + + +