1--TEST-- 2testing integer overflow (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 PHP_INT_MAX, 10 PHP_INT_MAX + 1, 11 PHP_INT_MAX + 1000, 12 PHP_INT_MAX * 2 + 4, 13 -PHP_INT_MAX -1, 14 -PHP_INT_MAX -2, 15 -PHP_INT_MAX -1000, 16 ); 17 18foreach ($doubles as $d) { 19 $l = (int)$d; 20 var_dump($l); 21} 22 23echo "Done\n"; 24?> 25--EXPECT-- 26int(9223372036854775807) 27int(-9223372036854775808) 28int(-9223372036854775808) 29int(0) 30int(-9223372036854775808) 31int(-9223372036854775808) 32int(-9223372036854775808) 33Done 34