Annotation of embedaddon/php/ext/json/tests/bug54484.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #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
! 7: json_decode('{"test":"test"}');
! 8: var_dump(json_last_error());
! 9:
! 10: json_decode("");
! 11: var_dump(json_last_error());
! 12:
! 13:
! 14: json_decode("invalid json");
! 15: var_dump(json_last_error());
! 16:
! 17:
! 18: json_decode("");
! 19: var_dump(json_last_error());
! 20: ?>
! 21: --EXPECT--
! 22: int(0)
! 23: int(0)
! 24: int(4)
! 25: int(0)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>