Debian Codegraph @

codelitephp/resources/cc/json.php

raw
1 <?php
2
3 // Start of json v.1.2.1
4
5 interface JsonSerializable {
6
7 /**
8 * Specify data which should be serialized to JSON
9 * @link http://www.php.net/manual/en/jsonserializable.jsonserialize.php
10 * @return mixed data which can be serialized by json_encode,
11 * which is a value of any type other than a resource.
12 */
13 abstract public function jsonSerialize () ;
14
15 }
16
17 /**
18 * Returns the JSON representation of a value
19 * @link http://www.php.net/manual/en/function.json-encode.php
20 * @param value mixed <p>
21 * The value being encoded. Can be any type except
22 * a resource.
23 * </p>
24 * <p>
25 * All string data must be UTF-8 encoded.
26 * </p>
27 * &json.implementation.superset;
28 * @param options int[optional] <p>
29 * Bitmask consisting of JSON_HEX_QUOT,
30 * JSON_HEX_TAG,
31 * JSON_HEX_AMP,
32 * JSON_HEX_APOS,
33 * JSON_NUMERIC_CHECK,
34 * JSON_PRETTY_PRINT,
35 * JSON_UNESCAPED_SLASHES,
36 * JSON_FORCE_OBJECT,
37 * JSON_UNESCAPED_UNICODE. The behaviour of these
38 * constants is described on
39 * the JSON constants page.
40 * </p>
41 * @param depth int[optional] <p>
42 * Set the maximum depth. Must be greater than zero.
43 * </p>
44 * @return string a JSON encoded string on success &return.falseforfailure;.
45 */
46 function json_encode ($value, $options = null, $depth = null) {}
47
48 /**
49 * Decodes a JSON string
50 * @link http://www.php.net/manual/en/function.json-decode.php
51 * @param json string <p>
52 * The json string being decoded.
53 * </p>
54 * <p>
55 * This function only works with UTF-8 encoded strings.
56 * </p>
57 * &json.implementation.superset;
58 * @param assoc bool[optional] <p>
59 * When true, returned objects will be converted into
60 * associative arrays.
61 * </p>
62 * @param depth int[optional] <p>
63 * User specified recursion depth.
64 * </p>
65 * @param options int[optional] <p>
66 * Bitmask of JSON decode options. Currently only
67 * JSON_BIGINT_AS_STRING
68 * is supported (default is to cast large integers as floats)
69 * </p>
70 * @return mixed the value encoded in json in appropriate
71 * PHP type. Values true, false and
72 * null are returned as true, false and &null;
73 * respectively. &null; is returned if the json cannot
74 * be decoded or if the encoded data is deeper than the recursion limit.
75 */
76 function json_decode ($json, $assoc = null, $depth = null, $options = null) {}
77
78 /**
79 * Returns the last error occurred
80 * @link http://www.php.net/manual/en/function.json-last-error.php
81 * @return int an integer, the value can be one of the following
82 * constants:
83 */
84 function json_last_error () {}
85
86 /**
87 * Returns the error string of the last json_encode() or json_decode() call
88 * @link http://www.php.net/manual/en/function.json-last-error-msg.php
89 * @return string the error message on success, "No Error" if no
90 * error has occurred, &return.falseforfailure;.
91 */
92 function json_last_error_msg () {}
93
94
95 /**
96 * All < and > are converted to \u003C and \u003E.
97 * Available since PHP 5.3.0.
98 * @link http://www.php.net/manual/en/json.constants.php
99 */
100 define ('JSON_HEX_TAG', 1);
101
102 /**
103 * All &s are converted to \u0026.
104 * Available since PHP 5.3.0.
105 * @link http://www.php.net/manual/en/json.constants.php
106 */
107 define ('JSON_HEX_AMP', 2);
108
109 /**
110 * All ' are converted to \u0027.
111 * Available since PHP 5.3.0.
112 * @link http://www.php.net/manual/en/json.constants.php
113 */
114 define ('JSON_HEX_APOS', 4);
115
116 /**
117 * All " are converted to \u0022.
118 * Available since PHP 5.3.0.
119 * @link http://www.php.net/manual/en/json.constants.php
120 */
121 define ('JSON_HEX_QUOT', 8);
122
123 /**
124 * Outputs an object rather than an array when a non-associative array is
125 * used. Especially useful when the recipient of the output is expecting
126 * an object and the array is empty.
127 * Available since PHP 5.3.0.
128 * @link http://www.php.net/manual/en/json.constants.php
129 */
130 define ('JSON_FORCE_OBJECT', 16);
131
132 /**
133 * Encodes numeric strings as numbers.
134 * Available since PHP 5.3.3.
135 * @link http://www.php.net/manual/en/json.constants.php
136 */
137 define ('JSON_NUMERIC_CHECK', 32);
138
139 /**
140 * Don't escape /.
141 * Available since PHP 5.4.0.
142 * @link http://www.php.net/manual/en/json.constants.php
143 */
144 define ('JSON_UNESCAPED_SLASHES', 64);
145
146 /**
147 * Use whitespace in returned data to format it.
148 * Available since PHP 5.4.0.
149 * @link http://www.php.net/manual/en/json.constants.php
150 */
151 define ('JSON_PRETTY_PRINT', 128);
152
153 /**
154 * Encode multibyte Unicode characters literally (default is to escape as \uXXXX).
155 * Available since PHP 5.4.0.
156 * @link http://www.php.net/manual/en/json.constants.php
157 */
158 define ('JSON_UNESCAPED_UNICODE', 256);
159 define ('JSON_PARTIAL_OUTPUT_ON_ERROR', 512);
160
161 /**
162 * No error has occurred.
163 * Available since PHP 5.3.0.
164 * @link http://www.php.net/manual/en/json.constants.php
165 */
166 define ('JSON_ERROR_NONE', 0);
167
168 /**
169 * The maximum stack depth has been exceeded.
170 * Available since PHP 5.3.0.
171 * @link http://www.php.net/manual/en/json.constants.php
172 */
173 define ('JSON_ERROR_DEPTH', 1);
174
175 /**
176 * Occurs with underflow or with the modes mismatch.
177 * Available since PHP 5.3.0.
178 * @link http://www.php.net/manual/en/json.constants.php
179 */
180 define ('JSON_ERROR_STATE_MISMATCH', 2);
181
182 /**
183 * Control character error, possibly incorrectly encoded.
184 * Available since PHP 5.3.0.
185 * @link http://www.php.net/manual/en/json.constants.php
186 */
187 define ('JSON_ERROR_CTRL_CHAR', 3);
188
189 /**
190 * Syntax error.
191 * Available since PHP 5.3.0.
192 * @link http://www.php.net/manual/en/json.constants.php
193 */
194 define ('JSON_ERROR_SYNTAX', 4);
195
196 /**
197 * Malformed UTF-8 characters, possibly incorrectly encoded. This
198 * constant is available as of PHP 5.3.3.
199 * @link http://www.php.net/manual/en/json.constants.php
200 */
201 define ('JSON_ERROR_UTF8', 5);
202
203 /**
204 * <p>
205 * The object or array passed to json_encode include
206 * recursive references and cannot be encoded.
207 * If the JSON_PARTIAL_OUTPUT_ON_ERROR option was
208 * given, &null; will be encoded in the place of the recursive reference.
209 * </p>
210 * <p>
211 * This constant is available as of PHP 5.5.0.
212 * </p>
213 * @link http://www.php.net/manual/en/json.constants.php
214 */
215 define ('JSON_ERROR_RECURSION', 6);
216
217 /**
218 * <p>
219 * The value passed to json_encode includes either
220 * NAN
221 * or INF.
222 * If the JSON_PARTIAL_OUTPUT_ON_ERROR option was
223 * given, 0 will be encoded in the place of these
224 * special numbers.
225 * </p>
226 * <p>
227 * This constant is available as of PHP 5.5.0.
228 * </p>
229 * @link http://www.php.net/manual/en/json.constants.php
230 */
231 define ('JSON_ERROR_INF_OR_NAN', 7);
232
233 /**
234 * <p>
235 * A value of an unsupported type was given to
236 * json_encode, such as a resource.
237 * If the JSON_PARTIAL_OUTPUT_ON_ERROR option was
238 * given, &null; will be encoded in the place of the unsupported value.
239 * </p>
240 * <p>
241 * This constant is available as of PHP 5.5.0.
242 * </p>
243 * @link http://www.php.net/manual/en/json.constants.php
244 */
245 define ('JSON_ERROR_UNSUPPORTED_TYPE', 8);
246 define ('JSON_OBJECT_AS_ARRAY', 1);
247
248 /**
249 * Encodes large integers as their original string value.
250 * Available since PHP 5.4.0.
251 * @link http://www.php.net/manual/en/json.constants.php
252 */
253 define ('JSON_BIGINT_AS_STRING', 2);
254
255 // End of json v.1.2.1
256 ?>