diff options
| author | Marcus Boerger <helly@php.net> | 2005-01-24 19:16:06 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2005-01-24 19:16:06 +0000 |
| commit | be86e1696eee134e993f2b45c738f457fa65fabd (patch) | |
| tree | 9731a391783e4d981079394eb0895732286081b8 | |
| parent | 2f55df7d1027ba92bdb0be52b3bef1eb5fe0283e (diff) | |
| download | php-git-be86e1696eee134e993f2b45c738f457fa65fabd.tar.gz | |
- Add new test
| -rwxr-xr-x | Zend/tests/bug30725.phpt | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Zend/tests/bug30725.phpt b/Zend/tests/bug30725.phpt new file mode 100755 index 0000000000..511ab815f3 --- /dev/null +++ b/Zend/tests/bug30725.phpt @@ -0,0 +1,32 @@ +--TEST-- +Bug #30725 (PHP segfaults when an exception is thrown in getIterator() within foreach) +--FILE-- +<?php + +class Test implements IteratorAggregate +{ + function getIterator() + { + throw new Exception(); + } +} + +try +{ + $it = new Test; + foreach($it as $v) + { + echo "Fail\n"; + } + echo "Wrong\n"; +} +catch(Exception $e) +{ + echo "Caught\n"; +} + +?> +===DONE=== +---EXPECT--- +Caught +===DONE=== |
