summaryrefslogtreecommitdiff
path: root/ext/json/tests/007.phpt
blob: 9ee190a24cdc9059fa29d33a3103c837ced04b35 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--TEST--
json_last_error() tests
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
var_dump(json_decode("[1]"));
var_dump(json_last_error());
var_dump(json_decode("[[1]]", false, 2));
var_dump(json_last_error());
var_dump(json_decode("[1}"));
var_dump(json_last_error());
var_dump(json_decode('["' . chr(0) . 'abcd"]'));
var_dump(json_last_error());
var_dump(json_decode("[1"));
var_dump(json_last_error());


echo "Done\n";
?>
--EXPECT--
array(1) {
  [0]=>
  int(1)
}
int(0)
NULL
int(1)
NULL
int(2)
NULL
int(3)
NULL
int(4)
Done