xref: /PHP-5.6/ext/json/tests/bug54484.phpt (revision e5abc537)
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
13json_decode("invalid json");
14var_dump(json_last_error());
15
16json_decode("");
17var_dump(json_last_error());
18?>
19--EXPECT--
20int(0)
21int(0)
22int(4)
23int(0)
24