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