summaryrefslogtreecommitdiff
path: root/ext/spl/tests/SplArray_fromArray.phpt
blob: 1144f5f8dccca2aa387980b420d6c57d43667c08 (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