Annotation of embedaddon/php/ext/json/tests/bug47644.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #47644 (valid large integers are truncated)
! 3: --SKIPIF--
! 4: <?php
! 5: if (!extension_loaded('json')) die('skip: json extension not available');
! 6: if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
! 7: ?>
! 8: --FILE--
! 9: <?php
! 10:
! 11: for ($i = 10000000000000000; $i < 10000000000000006; $i++) {
! 12: var_dump(json_decode("[$i]"));
! 13: }
! 14:
! 15:
! 16: echo "Done\n";
! 17: ?>
! 18: --EXPECT--
! 19: array(1) {
! 20: [0]=>
! 21: int(10000000000000000)
! 22: }
! 23: array(1) {
! 24: [0]=>
! 25: int(10000000000000001)
! 26: }
! 27: array(1) {
! 28: [0]=>
! 29: int(10000000000000002)
! 30: }
! 31: array(1) {
! 32: [0]=>
! 33: int(10000000000000003)
! 34: }
! 35: array(1) {
! 36: [0]=>
! 37: int(10000000000000004)
! 38: }
! 39: array(1) {
! 40: [0]=>
! 41: int(10000000000000005)
! 42: }
! 43: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>