summaryrefslogtreecommitdiff
path: root/ext/json/tests/bug54484.phpt
blob: e56d8bd86be92e80c0b66a51e5619e7cccda0691 (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
--TEST--
Bug #54484 (Empty string in json_decode doesn't reset json_last_error)
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
json_decode('{"test":"test"}');
var_dump(json_last_error());

json_decode("");
var_dump(json_last_error());


json_decode("invalid json");
var_dump(json_last_error());


json_decode("\001 invalid json");
var_dump(json_last_error());


json_decode("");
var_dump(json_last_error());
?>
--EXPECT--
int(0)
int(4)
int(4)
int(3)
int(4)