xref: /PHP-5.3/ext/json/tests/bug54484.phpt (revision 52cc62d8)
1--TEST--
2Bug #54484 (Empty string in json_decode doesn't reset json_last_error)
3--SKIPIF--
4<?php if (!extension_loaded("json")) print "skip"; ?>
5--FILE--
6<?php
7json_decode('{"test":"test"}');
8var_dump(json_last_error());
9
10json_decode("");
11var_dump(json_last_error());
12
13
14json_decode("invalid json");
15var_dump(json_last_error());
16
17
18json_decode("");
19var_dump(json_last_error());
20?>
21--EXPECT--
22int(0)
23int(0)
24int(4)
25int(0)
26