dis-bench / src /php /php-src /Zend /tests /exceptions /bug30725.phpt
meddyrat's picture
Replace repository contents with the original corrected artifact
1e94262
Raw History Blame Contribute Delete
413 Bytes
--TEST--
Bug #30725 (PHP segfaults when an exception is thrown in getIterator() within foreach)
--FILE--
<?php
class Test implements IteratorAggregate
{
function getIterator(): Traversable
{
throw new Exception();
}
}
try
{
$it = new Test;
foreach($it as $v)
{
echo "Fail\n";
}
echo "Wrong\n";
}
catch(Exception $e)
{
echo "Caught\n";
}
?>
--EXPECT--
Caught