xref: /PHP-5.3/ext/json/tests/bug47644.phpt (revision 07e675cc)
1--TEST--
2Bug #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
11for ($i = 10000000000000000; $i < 10000000000000006; $i++) {
12	var_dump(json_decode("[$i]"));
13}
14
15
16echo "Done\n";
17?>
18--EXPECT--
19array(1) {
20  [0]=>
21  int(10000000000000000)
22}
23array(1) {
24  [0]=>
25  int(10000000000000001)
26}
27array(1) {
28  [0]=>
29  int(10000000000000002)
30}
31array(1) {
32  [0]=>
33  int(10000000000000003)
34}
35array(1) {
36  [0]=>
37  int(10000000000000004)
38}
39array(1) {
40  [0]=>
41  int(10000000000000005)
42}
43Done
44