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