mirror of
https://github.com/php/php-src.git
synced 2024-09-23 19:07:26 +00:00
28 lines
491 B
PHP
28 lines
491 B
PHP
--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)
|