Annotation of embedaddon/php/Zend/tests/int_overflow_64bit.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: testing 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:
! 18: foreach ($doubles as $d) {
! 19: $l = (int)$d;
! 20: var_dump($l);
! 21: }
! 22:
! 23: echo "Done\n";
! 24: ?>
! 25: --EXPECT--
! 26: int(9223372036854775807)
! 27: int(-9223372036854775808)
! 28: int(-9223372036854775808)
! 29: int(0)
! 30: int(-9223372036854775808)
! 31: int(-9223372036854775808)
! 32: int(-9223372036854775808)
! 33: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>