int_underflow_32bit.phpt 444 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. testing 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. $doubles = array(
  8. -2147483648,
  9. -2147483649,
  10. -2147483658,
  11. -2147483748,
  12. -2147484648,
  13. );
  14. foreach ($doubles as $d) {
  15. $l = (int)$d;
  16. var_dump($l);
  17. }
  18. echo "Done\n";
  19. ?>
  20. --EXPECT--
  21. int(-2147483648)
  22. int(2147483647)
  23. int(2147483638)
  24. int(2147483548)
  25. int(2147482648)
  26. Done