Annotation of embedaddon/php/ext/json/tests/002.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: json_encode() tests
                      3: --SKIPIF--
                      4: <?php if (!extension_loaded("json")) print "skip"; ?>
                      5: --FILE--
                      6: <?php
                      7: 
                      8: var_dump(json_encode(""));
                      9: var_dump(json_encode(NULL));
                     10: var_dump(json_encode(TRUE));
                     11: 
                     12: var_dump(json_encode(array(""=>"")));
                     13: var_dump(json_encode(array(array(1))));
                     14: var_dump(json_encode(array()));
                     15: 
                     16: var_dump(json_encode(array(""=>""), JSON_FORCE_OBJECT));
                     17: var_dump(json_encode(array(array(1)), JSON_FORCE_OBJECT));
                     18: var_dump(json_encode(array(), JSON_FORCE_OBJECT));
                     19: 
                     20: var_dump(json_encode(1));
                     21: var_dump(json_encode("руссиш"));
                     22: 
                     23: 
                     24: echo "Done\n";
                     25: ?>
                     26: --EXPECTF--    
                     27: string(2) """"
                     28: string(4) "null"
                     29: string(4) "true"
                     30: string(7) "{"":""}"
                     31: string(5) "[[1]]"
                     32: string(2) "[]"
                     33: string(7) "{"":""}"
                     34: string(13) "{"0":{"0":1}}"
                     35: string(2) "{}"
                     36: string(1) "1"
                     37: string(38) ""\u0440\u0443\u0441\u0441\u0438\u0448""
                     38: Done

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>