php-src/Zend/tests/bug30725.phpt

33 lines
395 B
Plaintext
Raw Normal View History

2005-01-24 19:16:06 +00:00
--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===
2005-01-24 20:02:55 +00:00
--EXPECT--
2005-01-24 19:16:06 +00:00
Caught
===DONE===