xref: /PHP-7.3/ext/json/tests/pass001.1.phpt (revision 9c8b3ae4)
1--TEST--
2JSON (http://www.crockford.com/JSON/JSON_checker/test/pass1.json)
3--INI--
4serialize_precision=-1
5--SKIPIF--
6<?php
7if (!extension_loaded('json')) die('skip json extension not loaded');
8?>
9--FILE--
10<?php
11/* Modified to test unescaped UNICODE as keys and values.
12 * Modified to test numbers with exponents without a decimal point.
13 * Modified to test empty string values.
14 * Modified to test a mix of integers and strings as keys.
15 */
16
17$test = "
18[
19    \"JSON Test Pattern pass1\",
20    {\"object with 1 member\":[\"array with 1 element\"]},
21    {},
22    [],
23    -42,
24    true,
25    false,
26    null,
27    {
28        \"integer\": 1234567890,
29        \"real\": -9876.543210,
30        \"e\": 0.123456789e-12,
31        \"E\": 1.234567890E+34,
32        \"\":  23456789012E666,
33        \"E no .\":  4E12,
34        \"zero\": 0,
35        \"one\": 1,
36        \"space\": \" \",
37        \"quote\": \"\\\"\",
38        \"backslash\": \"\\\\\",
39        \"controls\": \"\\b\\f\\n\\r\\t\",
40        \"slash\": \"/ & \\/\",
41        \"alpha\": \"abcdefghijklmnopqrstuvwyz\",
42        \"ALPHA\": \"ABCDEFGHIJKLMNOPQRSTUVWYZ\",
43        \"digit\": \"0123456789\",
44        \"special\": \"`1~!@#$%^&*()_+-={':[,]}|;.</>?\",
45        \"hex\": \"\\u0123\\u4567\\u89AB\\uCDEF\\uabcd\\uef4A\",
46        \"unicode\": \"\\u30d7\\u30ec\\u30b9\\u30ad\\u30c3\\u30c8\",
47        \"プレスキット\": \"プレスキット\",
48        \"empty_string\": \"\",
49        \"true\": true,
50        \"false\": false,
51        \"null\": null,
52        \"array\":[  ],
53        \"object\":{  },
54        \"123\":{\"456\":{\"abc\":{\"789\":\"def\",\"012\":[1,2,\"5\",500],\"ghi\":[1,2,\"five\",50,\"sixty\"]}}},
55        \"address\": \"50 St. James Street\",
56        \"url\": \"http://www.JSON.org/\",
57        \"comment\": \"// /* <!-- --\",
58        \"# -- --> */\": \" \",
59        \" s p a c e d \" :[1,2 , 3
60
61,
62
634 , 5        ,          6           ,7        ],
64        \"compact\": [1,2,3,4,5,6,7],
65        \"jsontext\": \"{\\\"object with 1 member\\\":[\\\"array with 1 element\\\"]}\",
66        \"quotes\": \"&#34; \\u0022 %22 0x22 034 &#x22;\",
67        \"\\/\\\\\\\"\\uCAFE\\uBABE\\uAB98\\uFCDE\\ubcda\\uef4A\\b\\f\\n\\r\\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?\"
68: \"A key can be any string\"
69    },
70    0.5 ,98.6
71,
7299.44
73,
74
751066
76
77
78,\"rosebud\"]
79";
80
81echo 'Testing: ' . $test . "\n";
82echo "DECODE: AS OBJECT\n";
83$obj = json_decode($test);
84var_dump($obj);
85echo "DECODE: AS ARRAY\n";
86$arr = json_decode($test, true);
87var_dump($arr);
88
89echo "ENCODE: FROM OBJECT\n";
90$obj_enc = json_encode($obj, JSON_PARTIAL_OUTPUT_ON_ERROR);
91echo $obj_enc . "\n";
92echo "ENCODE: FROM ARRAY\n";
93$arr_enc = json_encode($arr, JSON_PARTIAL_OUTPUT_ON_ERROR);
94echo $arr_enc . "\n";
95
96echo "DECODE AGAIN: AS OBJECT\n";
97$obj = json_decode($obj_enc);
98var_dump($obj);
99echo "DECODE AGAIN: AS ARRAY\n";
100$arr = json_decode($arr_enc, true);
101var_dump($arr);
102
103?>
104--EXPECTF--
105Testing:
106[
107    "JSON Test Pattern pass1",
108    {"object with 1 member":["array with 1 element"]},
109    {},
110    [],
111    -42,
112    true,
113    false,
114    null,
115    {
116        "integer": 1234567890,
117        "real": -9876.543210,
118        "e": 0.123456789e-12,
119        "E": 1.234567890E+34,
120        "":  23456789012E666,
121        "E no .":  4E12,
122        "zero": 0,
123        "one": 1,
124        "space": " ",
125        "quote": "\"",
126        "backslash": "\\",
127        "controls": "\b\f\n\r\t",
128        "slash": "/ & \/",
129        "alpha": "abcdefghijklmnopqrstuvwyz",
130        "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
131        "digit": "0123456789",
132        "special": "`1~!@#$%^&*()_+-={':[,]}|;.</>?",
133        "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A",
134        "unicode": "\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8",
135        "プレスキット": "プレスキット",
136        "empty_string": "",
137        "true": true,
138        "false": false,
139        "null": null,
140        "array":[  ],
141        "object":{  },
142        "123":{"456":{"abc":{"789":"def","012":[1,2,"5",500],"ghi":[1,2,"five",50,"sixty"]}}},
143        "address": "50 St. James Street",
144        "url": "http://www.JSON.org/",
145        "comment": "// /* <!-- --",
146        "# -- --> */": " ",
147        " s p a c e d " :[1,2 , 3
148
149,
150
1514 , 5        ,          6           ,7        ],
152        "compact": [1,2,3,4,5,6,7],
153        "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}",
154        "quotes": "&#34; \u0022 %22 0x22 034 &#x22;",
155        "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
156: "A key can be any string"
157    },
158    0.5 ,98.6
159,
16099.44
161,
162
1631066
164
165
166,"rosebud"]
167
168DECODE: AS OBJECT
169array(14) {
170  [0]=>
171  string(23) "JSON Test Pattern pass1"
172  [1]=>
173  object(stdClass)#%d (1) {
174    ["object with 1 member"]=>
175    array(1) {
176      [0]=>
177      string(20) "array with 1 element"
178    }
179  }
180  [2]=>
181  object(stdClass)#%d (0) {
182  }
183  [3]=>
184  array(0) {
185  }
186  [4]=>
187  int(-42)
188  [5]=>
189  bool(true)
190  [6]=>
191  bool(false)
192  [7]=>
193  NULL
194  [8]=>
195  object(stdClass)#%d (36) {
196    ["integer"]=>
197    int(1234567890)
198    ["real"]=>
199    float(-9876.54321)
200    ["e"]=>
201    float(1.23456789E-13)
202    ["E"]=>
203    float(1.23456789E+34)
204    [""]=>
205    float(INF)
206    ["E no ."]=>
207    float(4000000000000)
208    ["zero"]=>
209    int(0)
210    ["one"]=>
211    int(1)
212    ["space"]=>
213    string(1) " "
214    ["quote"]=>
215    string(1) """
216    ["backslash"]=>
217    string(1) "\"
218    ["controls"]=>
219    string(5) "
220
220	"
221    ["slash"]=>
222    string(5) "/ & /"
223    ["alpha"]=>
224    string(25) "abcdefghijklmnopqrstuvwyz"
225    ["ALPHA"]=>
226    string(25) "ABCDEFGHIJKLMNOPQRSTUVWYZ"
227    ["digit"]=>
228    string(10) "0123456789"
229    ["special"]=>
230    string(31) "`1~!@#$%^&*()_+-={':[,]}|;.</>?"
231    ["hex"]=>
232    string(17) "ģ䕧覫췯ꯍ"
233    ["unicode"]=>
234    string(18) "プレスキット"
235    ["プレスキット"]=>
236    string(18) "プレスキット"
237    ["empty_string"]=>
238    string(0) ""
239    ["true"]=>
240    bool(true)
241    ["false"]=>
242    bool(false)
243    ["null"]=>
244    NULL
245    ["array"]=>
246    array(0) {
247    }
248    ["object"]=>
249    object(stdClass)#%d (0) {
250    }
251    ["123"]=>
252    object(stdClass)#%d (1) {
253      ["456"]=>
254      object(stdClass)#%d (1) {
255        ["abc"]=>
256        object(stdClass)#%d (3) {
257          ["789"]=>
258          string(3) "def"
259          ["012"]=>
260          array(4) {
261            [0]=>
262            int(1)
263            [1]=>
264            int(2)
265            [2]=>
266            string(1) "5"
267            [3]=>
268            int(500)
269          }
270          ["ghi"]=>
271          array(5) {
272            [0]=>
273            int(1)
274            [1]=>
275            int(2)
276            [2]=>
277            string(4) "five"
278            [3]=>
279            int(50)
280            [4]=>
281            string(5) "sixty"
282          }
283        }
284      }
285    }
286    ["address"]=>
287    string(19) "50 St. James Street"
288    ["url"]=>
289    string(20) "http://www.JSON.org/"
290    ["comment"]=>
291    string(13) "// /* <!-- --"
292    ["# -- --> */"]=>
293    string(1) " "
294    [" s p a c e d "]=>
295    array(7) {
296      [0]=>
297      int(1)
298      [1]=>
299      int(2)
300      [2]=>
301      int(3)
302      [3]=>
303      int(4)
304      [4]=>
305      int(5)
306      [5]=>
307      int(6)
308      [6]=>
309      int(7)
310    }
311    ["compact"]=>
312    array(7) {
313      [0]=>
314      int(1)
315      [1]=>
316      int(2)
317      [2]=>
318      int(3)
319      [3]=>
320      int(4)
321      [4]=>
322      int(5)
323      [5]=>
324      int(6)
325      [6]=>
326      int(7)
327    }
328    ["jsontext"]=>
329    string(49) "{"object with 1 member":["array with 1 element"]}"
330    ["quotes"]=>
331    string(27) "&#34; " %22 0x22 034 &#x22;"
332    ["/\"쫾몾ꮘﳞ볚
333
333	`1~!@#$%^&*()_+-=[]{}|;:',./<>?"]=>
334    string(23) "A key can be any string"
335  }
336  [9]=>
337  float(0.5)
338  [10]=>
339  float(98.6)
340  [11]=>
341  float(99.44)
342  [12]=>
343  int(1066)
344  [13]=>
345  string(7) "rosebud"
346}
347DECODE: AS ARRAY
348array(14) {
349  [0]=>
350  string(23) "JSON Test Pattern pass1"
351  [1]=>
352  array(1) {
353    ["object with 1 member"]=>
354    array(1) {
355      [0]=>
356      string(20) "array with 1 element"
357    }
358  }
359  [2]=>
360  array(0) {
361  }
362  [3]=>
363  array(0) {
364  }
365  [4]=>
366  int(-42)
367  [5]=>
368  bool(true)
369  [6]=>
370  bool(false)
371  [7]=>
372  NULL
373  [8]=>
374  array(36) {
375    ["integer"]=>
376    int(1234567890)
377    ["real"]=>
378    float(-9876.54321)
379    ["e"]=>
380    float(1.23456789E-13)
381    ["E"]=>
382    float(1.23456789E+34)
383    [""]=>
384    float(INF)
385    ["E no ."]=>
386    float(4000000000000)
387    ["zero"]=>
388    int(0)
389    ["one"]=>
390    int(1)
391    ["space"]=>
392    string(1) " "
393    ["quote"]=>
394    string(1) """
395    ["backslash"]=>
396    string(1) "\"
397    ["controls"]=>
398    string(5) "
399
399	"
400    ["slash"]=>
401    string(5) "/ & /"
402    ["alpha"]=>
403    string(25) "abcdefghijklmnopqrstuvwyz"
404    ["ALPHA"]=>
405    string(25) "ABCDEFGHIJKLMNOPQRSTUVWYZ"
406    ["digit"]=>
407    string(10) "0123456789"
408    ["special"]=>
409    string(31) "`1~!@#$%^&*()_+-={':[,]}|;.</>?"
410    ["hex"]=>
411    string(17) "ģ䕧覫췯ꯍ"
412    ["unicode"]=>
413    string(18) "プレスキット"
414    ["プレスキット"]=>
415    string(18) "プレスキット"
416    ["empty_string"]=>
417    string(0) ""
418    ["true"]=>
419    bool(true)
420    ["false"]=>
421    bool(false)
422    ["null"]=>
423    NULL
424    ["array"]=>
425    array(0) {
426    }
427    ["object"]=>
428    array(0) {
429    }
430    [123]=>
431    array(1) {
432      [456]=>
433      array(1) {
434        ["abc"]=>
435        array(3) {
436          [789]=>
437          string(3) "def"
438          ["012"]=>
439          array(4) {
440            [0]=>
441            int(1)
442            [1]=>
443            int(2)
444            [2]=>
445            string(1) "5"
446            [3]=>
447            int(500)
448          }
449          ["ghi"]=>
450          array(5) {
451            [0]=>
452            int(1)
453            [1]=>
454            int(2)
455            [2]=>
456            string(4) "five"
457            [3]=>
458            int(50)
459            [4]=>
460            string(5) "sixty"
461          }
462        }
463      }
464    }
465    ["address"]=>
466    string(19) "50 St. James Street"
467    ["url"]=>
468    string(20) "http://www.JSON.org/"
469    ["comment"]=>
470    string(13) "// /* <!-- --"
471    ["# -- --> */"]=>
472    string(1) " "
473    [" s p a c e d "]=>
474    array(7) {
475      [0]=>
476      int(1)
477      [1]=>
478      int(2)
479      [2]=>
480      int(3)
481      [3]=>
482      int(4)
483      [4]=>
484      int(5)
485      [5]=>
486      int(6)
487      [6]=>
488      int(7)
489    }
490    ["compact"]=>
491    array(7) {
492      [0]=>
493      int(1)
494      [1]=>
495      int(2)
496      [2]=>
497      int(3)
498      [3]=>
499      int(4)
500      [4]=>
501      int(5)
502      [5]=>
503      int(6)
504      [6]=>
505      int(7)
506    }
507    ["jsontext"]=>
508    string(49) "{"object with 1 member":["array with 1 element"]}"
509    ["quotes"]=>
510    string(27) "&#34; " %22 0x22 034 &#x22;"
511    ["/\"쫾몾ꮘﳞ볚
512
512	`1~!@#$%^&*()_+-=[]{}|;:',./<>?"]=>
513    string(23) "A key can be any string"
514  }
515  [9]=>
516  float(0.5)
517  [10]=>
518  float(98.6)
519  [11]=>
520  float(99.44)
521  [12]=>
522  int(1066)
523  [13]=>
524  string(7) "rosebud"
525}
526ENCODE: FROM OBJECT
527["JSON Test Pattern pass1",{"object with 1 member":["array with 1 element"]},{},[],-42,true,false,null,{"integer":1234567890,"real":-9876.54321,"e":1.23456789e-13,"E":1.23456789e+34,"":0,"E no .":4000000000000,"zero":0,"one":1,"space":" ","quote":"\"","backslash":"\\","controls":"\b\f\n\r\t","slash":"\/ & \/","alpha":"abcdefghijklmnopqrstuvwyz","ALPHA":"ABCDEFGHIJKLMNOPQRSTUVWYZ","digit":"0123456789","special":"`1~!@#$%^&*()_+-={':[,]}|;.<\/>?","hex":"\u0123\u4567\u89ab\ucdef\uabcd\uef4a","unicode":"\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8","\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8":"\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8","empty_string":"","true":true,"false":false,"null":null,"array":[],"object":{},"123":{"456":{"abc":{"789":"def","012":[1,2,"5",500],"ghi":[1,2,"five",50,"sixty"]}}},"address":"50 St. James Street","url":"http:\/\/www.JSON.org\/","comment":"\/\/ \/* <!-- --","# -- --> *\/":" "," s p a c e d ":[1,2,3,4,5,6,7],"compact":[1,2,3,4,5,6,7],"jsontext":"{\"object with 1 member\":[\"array with 1 element\"]}","quotes":"&#34; \" %22 0x22 034 &#x22;","\/\\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',.\/<>?":"A key can be any string"},0.5,98.6,99.44,1066,"rosebud"]
528ENCODE: FROM ARRAY
529["JSON Test Pattern pass1",{"object with 1 member":["array with 1 element"]},[],[],-42,true,false,null,{"integer":1234567890,"real":-9876.54321,"e":1.23456789e-13,"E":1.23456789e+34,"":0,"E no .":4000000000000,"zero":0,"one":1,"space":" ","quote":"\"","backslash":"\\","controls":"\b\f\n\r\t","slash":"\/ & \/","alpha":"abcdefghijklmnopqrstuvwyz","ALPHA":"ABCDEFGHIJKLMNOPQRSTUVWYZ","digit":"0123456789","special":"`1~!@#$%^&*()_+-={':[,]}|;.<\/>?","hex":"\u0123\u4567\u89ab\ucdef\uabcd\uef4a","unicode":"\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8","\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8":"\u30d7\u30ec\u30b9\u30ad\u30c3\u30c8","empty_string":"","true":true,"false":false,"null":null,"array":[],"object":[],"123":{"456":{"abc":{"789":"def","012":[1,2,"5",500],"ghi":[1,2,"five",50,"sixty"]}}},"address":"50 St. James Street","url":"http:\/\/www.JSON.org\/","comment":"\/\/ \/* <!-- --","# -- --> *\/":" "," s p a c e d ":[1,2,3,4,5,6,7],"compact":[1,2,3,4,5,6,7],"jsontext":"{\"object with 1 member\":[\"array with 1 element\"]}","quotes":"&#34; \" %22 0x22 034 &#x22;","\/\\\"\ucafe\ubabe\uab98\ufcde\ubcda\uef4a\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',.\/<>?":"A key can be any string"},0.5,98.6,99.44,1066,"rosebud"]
530DECODE AGAIN: AS OBJECT
531array(14) {
532  [0]=>
533  string(23) "JSON Test Pattern pass1"
534  [1]=>
535  object(stdClass)#%d (1) {
536    ["object with 1 member"]=>
537    array(1) {
538      [0]=>
539      string(20) "array with 1 element"
540    }
541  }
542  [2]=>
543  object(stdClass)#%d (0) {
544  }
545  [3]=>
546  array(0) {
547  }
548  [4]=>
549  int(-42)
550  [5]=>
551  bool(true)
552  [6]=>
553  bool(false)
554  [7]=>
555  NULL
556  [8]=>
557  object(stdClass)#%d (36) {
558    ["integer"]=>
559    int(1234567890)
560    ["real"]=>
561    float(-9876.54321)
562    ["e"]=>
563    float(1.23456789E-13)
564    ["E"]=>
565    float(1.23456789E+34)
566    [""]=>
567    int(0)
568    ["E no ."]=>
569    %s(4000000000000)
570    ["zero"]=>
571    int(0)
572    ["one"]=>
573    int(1)
574    ["space"]=>
575    string(1) " "
576    ["quote"]=>
577    string(1) """
578    ["backslash"]=>
579    string(1) "\"
580    ["controls"]=>
581    string(5) "
582
582	"
583    ["slash"]=>
584    string(5) "/ & /"
585    ["alpha"]=>
586    string(25) "abcdefghijklmnopqrstuvwyz"
587    ["ALPHA"]=>
588    string(25) "ABCDEFGHIJKLMNOPQRSTUVWYZ"
589    ["digit"]=>
590    string(10) "0123456789"
591    ["special"]=>
592    string(31) "`1~!@#$%^&*()_+-={':[,]}|;.</>?"
593    ["hex"]=>
594    string(17) "ģ䕧覫췯ꯍ"
595    ["unicode"]=>
596    string(18) "プレスキット"
597    ["プレスキット"]=>
598    string(18) "プレスキット"
599    ["empty_string"]=>
600    string(0) ""
601    ["true"]=>
602    bool(true)
603    ["false"]=>
604    bool(false)
605    ["null"]=>
606    NULL
607    ["array"]=>
608    array(0) {
609    }
610    ["object"]=>
611    object(stdClass)#%d (0) {
612    }
613    ["123"]=>
614    object(stdClass)#%d (1) {
615      ["456"]=>
616      object(stdClass)#%d (1) {
617        ["abc"]=>
618        object(stdClass)#%d (3) {
619          ["789"]=>
620          string(3) "def"
621          ["012"]=>
622          array(4) {
623            [0]=>
624            int(1)
625            [1]=>
626            int(2)
627            [2]=>
628            string(1) "5"
629            [3]=>
630            int(500)
631          }
632          ["ghi"]=>
633          array(5) {
634            [0]=>
635            int(1)
636            [1]=>
637            int(2)
638            [2]=>
639            string(4) "five"
640            [3]=>
641            int(50)
642            [4]=>
643            string(5) "sixty"
644          }
645        }
646      }
647    }
648    ["address"]=>
649    string(19) "50 St. James Street"
650    ["url"]=>
651    string(20) "http://www.JSON.org/"
652    ["comment"]=>
653    string(13) "// /* <!-- --"
654    ["# -- --> */"]=>
655    string(1) " "
656    [" s p a c e d "]=>
657    array(7) {
658      [0]=>
659      int(1)
660      [1]=>
661      int(2)
662      [2]=>
663      int(3)
664      [3]=>
665      int(4)
666      [4]=>
667      int(5)
668      [5]=>
669      int(6)
670      [6]=>
671      int(7)
672    }
673    ["compact"]=>
674    array(7) {
675      [0]=>
676      int(1)
677      [1]=>
678      int(2)
679      [2]=>
680      int(3)
681      [3]=>
682      int(4)
683      [4]=>
684      int(5)
685      [5]=>
686      int(6)
687      [6]=>
688      int(7)
689    }
690    ["jsontext"]=>
691    string(49) "{"object with 1 member":["array with 1 element"]}"
692    ["quotes"]=>
693    string(27) "&#34; " %22 0x22 034 &#x22;"
694    ["/\"쫾몾ꮘﳞ볚
695
695	`1~!@#$%^&*()_+-=[]{}|;:',./<>?"]=>
696    string(23) "A key can be any string"
697  }
698  [9]=>
699  float(0.5)
700  [10]=>
701  float(98.6)
702  [11]=>
703  float(99.44)
704  [12]=>
705  int(1066)
706  [13]=>
707  string(7) "rosebud"
708}
709DECODE AGAIN: AS ARRAY
710array(14) {
711  [0]=>
712  string(23) "JSON Test Pattern pass1"
713  [1]=>
714  array(1) {
715    ["object with 1 member"]=>
716    array(1) {
717      [0]=>
718      string(20) "array with 1 element"
719    }
720  }
721  [2]=>
722  array(0) {
723  }
724  [3]=>
725  array(0) {
726  }
727  [4]=>
728  int(-42)
729  [5]=>
730  bool(true)
731  [6]=>
732  bool(false)
733  [7]=>
734  NULL
735  [8]=>
736  array(36) {
737    ["integer"]=>
738    int(1234567890)
739    ["real"]=>
740    float(-9876.54321)
741    ["e"]=>
742    float(1.23456789E-13)
743    ["E"]=>
744    float(1.23456789E+34)
745    [""]=>
746    int(0)
747    ["E no ."]=>
748    %s(4000000000000)
749    ["zero"]=>
750    int(0)
751    ["one"]=>
752    int(1)
753    ["space"]=>
754    string(1) " "
755    ["quote"]=>
756    string(1) """
757    ["backslash"]=>
758    string(1) "\"
759    ["controls"]=>
760    string(5) "
761
761	"
762    ["slash"]=>
763    string(5) "/ & /"
764    ["alpha"]=>
765    string(25) "abcdefghijklmnopqrstuvwyz"
766    ["ALPHA"]=>
767    string(25) "ABCDEFGHIJKLMNOPQRSTUVWYZ"
768    ["digit"]=>
769    string(10) "0123456789"
770    ["special"]=>
771    string(31) "`1~!@#$%^&*()_+-={':[,]}|;.</>?"
772    ["hex"]=>
773    string(17) "ģ䕧覫췯ꯍ"
774    ["unicode"]=>
775    string(18) "プレスキット"
776    ["プレスキット"]=>
777    string(18) "プレスキット"
778    ["empty_string"]=>
779    string(0) ""
780    ["true"]=>
781    bool(true)
782    ["false"]=>
783    bool(false)
784    ["null"]=>
785    NULL
786    ["array"]=>
787    array(0) {
788    }
789    ["object"]=>
790    array(0) {
791    }
792    [123]=>
793    array(1) {
794      [456]=>
795      array(1) {
796        ["abc"]=>
797        array(3) {
798          [789]=>
799          string(3) "def"
800          ["012"]=>
801          array(4) {
802            [0]=>
803            int(1)
804            [1]=>
805            int(2)
806            [2]=>
807            string(1) "5"
808            [3]=>
809            int(500)
810          }
811          ["ghi"]=>
812          array(5) {
813            [0]=>
814            int(1)
815            [1]=>
816            int(2)
817            [2]=>
818            string(4) "five"
819            [3]=>
820            int(50)
821            [4]=>
822            string(5) "sixty"
823          }
824        }
825      }
826    }
827    ["address"]=>
828    string(19) "50 St. James Street"
829    ["url"]=>
830    string(20) "http://www.JSON.org/"
831    ["comment"]=>
832    string(13) "// /* <!-- --"
833    ["# -- --> */"]=>
834    string(1) " "
835    [" s p a c e d "]=>
836    array(7) {
837      [0]=>
838      int(1)
839      [1]=>
840      int(2)
841      [2]=>
842      int(3)
843      [3]=>
844      int(4)
845      [4]=>
846      int(5)
847      [5]=>
848      int(6)
849      [6]=>
850      int(7)
851    }
852    ["compact"]=>
853    array(7) {
854      [0]=>
855      int(1)
856      [1]=>
857      int(2)
858      [2]=>
859      int(3)
860      [3]=>
861      int(4)
862      [4]=>
863      int(5)
864      [5]=>
865      int(6)
866      [6]=>
867      int(7)
868    }
869    ["jsontext"]=>
870    string(49) "{"object with 1 member":["array with 1 element"]}"
871    ["quotes"]=>
872    string(27) "&#34; " %22 0x22 034 &#x22;"
873    ["/\"쫾몾ꮘﳞ볚
874
874	`1~!@#$%^&*()_+-=[]{}|;:',./<>?"]=>
875    string(23) "A key can be any string"
876  }
877  [9]=>
878  float(0.5)
879  [10]=>
880  float(98.6)
881  [11]=>
882  float(99.44)
883  [12]=>
884  int(1066)
885  [13]=>
886  string(7) "rosebud"
887}
888