Annotation of embedaddon/php/ext/json/tests/007.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: json_last_error() tests
3: --SKIPIF--
4: <?php if (!extension_loaded("json")) print "skip"; ?>
5: --FILE--
6: <?php
7: var_dump(json_decode("[1]"));
8: var_dump(json_last_error());
9: var_dump(json_decode("[[1]]", false, 2));
10: var_dump(json_last_error());
11: var_dump(json_decode("[1}"));
12: var_dump(json_last_error());
13: var_dump(json_decode('["' . chr(0) . 'abcd"]'));
14: var_dump(json_last_error());
15: var_dump(json_decode("[1"));
16: var_dump(json_last_error());
17:
18:
19: echo "Done\n";
20: ?>
21: --EXPECT--
22: array(1) {
23: [0]=>
24: int(1)
25: }
26: int(0)
27: NULL
28: int(1)
29: NULL
30: int(2)
31: NULL
32: int(3)
33: NULL
34: int(4)
35: Done
36:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>