1--TEST--
2testing integer underflow (32bit)
3--SKIPIF--
4<?php if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only"); ?>
5--FILE--
6<?php
7
8$doubles = array(
9    -2147483648,
10    -2147483649,
11    -2147483658,
12    -2147483748,
13    -2147484648,
14    );
15
16foreach ($doubles as $d) {
17    $l = (int)$d;
18    var_dump($l);
19}
20
21echo "Done\n";
22?>
23--EXPECT--
24int(-2147483648)
25int(2147483647)
26int(2147483638)
27int(2147483548)
28int(2147482648)
29Done
30