diff options
| author | Felipe Pena <felipe@php.net> | 2009-05-23 15:38:18 +0000 |
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2009-05-23 15:38:18 +0000 |
| commit | 0873648ef06c9a7db8c5085cc89fccb43f08fb76 (patch) | |
| tree | 3a23008e138070ed3677d327c84d0d24349c771a /ext/spl/tests/SplArray_fromArray.phpt | |
| parent | 941ac63eeff2642f890649a89a1b9fa9f81abec9 (diff) | |
| download | php-git-0873648ef06c9a7db8c5085cc89fccb43f08fb76.tar.gz | |
- New tests (testfest NorthWestUG)
Diffstat (limited to 'ext/spl/tests/SplArray_fromArray.phpt')
| -rw-r--r-- | ext/spl/tests/SplArray_fromArray.phpt | 17 |
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 0000000000..1144f5f8dc --- /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 |
