summaryrefslogtreecommitdiff
path: root/ext/spl/tests/SplArray_fromArray.phpt
blob: 143d2755a81de47f06103d7ba588908d1d7dbefb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--TEST--
Check that SplArray::fromArray will not allow integer overflows
--CREDITS--
Rob Knight <themanhimself@robknight.org.uk> PHPNW Test Fest 2009
--FILE--
<?php
$array = array(PHP_INT_MAX => 'foo');
$splArray = new SplFixedArray();

try {
  $splArray->fromArray($array);
} catch (Exception $e) {
  echo $e->getMessage();
}
?>
--EXPECT--
integer overflow detected