blob: 75cb04843c62bce373a8787f7124975734110c22 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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===
|