summaryrefslogtreecommitdiff
path: root/ext/spl/tests/SplArray_fromArray.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/SplArray_fromArray.phpt')
-rw-r--r--ext/spl/tests/SplArray_fromArray.phpt17
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/spl/tests/SplArray_fromArray.phpt b/ext/spl/tests/SplArray_fromArray.phpt
new file mode 100644
index 0000000..1144f5f
--- /dev/null
+++ b/ext/spl/tests/SplArray_fromArray.phpt
@@ -0,0 +1,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 \ No newline at end of file