summaryrefslogtreecommitdiff
path: root/ext/json/tests/bug40503.phpt
blob: 10896a428e9c3cd7183625e1f45065d7f9436ad9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--TEST--
Bug #40503 (json_encode() value corruption on 32bit systems with overflown values)
--INI--
serialize_precision=-1
--SKIPIF--
<?php if (!extension_loaded("json")) print "skip"; ?>
--FILE--
<?php
function json_test_show_eq($x, $y) {
	echo "$x ". ( $x == $y ? "==" : "!=") ." $y\n";
}

$value = 0x7FFFFFFF; #2147483647;
json_test_show_eq("$value", json_encode($value));
$value++;
json_test_show_eq("$value", json_encode($value));

?>
--EXPECT--
2147483647 == 2147483647
2147483648 == 2147483648