SplArray_fromArray.phpt 367 B

1234567891011121314151617
  1. --TEST--
  2. Check that SplArray::fromArray will not allow integer overflows
  3. --CREDITS--
  4. Rob Knight <themanhimself@robknight.org.uk> PHPNW Test Fest 2009
  5. --FILE--
  6. <?php
  7. $array = array(PHP_INT_MAX => 'foo');
  8. $splArray = new SplFixedArray();
  9. try {
  10. $splArray->fromArray($array);
  11. } catch (Exception $e) {
  12. echo $e->getMessage();
  13. }
  14. ?>
  15. --EXPECT--
  16. integer overflow detected