mirror of
https://github.com/php/php-src.git
synced 2024-09-23 19:07:26 +00:00
- Add new test
This commit is contained in:
parent
2f55df7d10
commit
be86e1696e
32
Zend/tests/bug30725.phpt
Executable file
32
Zend/tests/bug30725.phpt
Executable file
@ -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===
|
Loading…
Reference in New Issue
Block a user