summaryrefslogtreecommitdiff
path: root/Zend/tests/bug30725.phpt
blob: ce6c9a50a260910a3a6322cb9d5517c50846b8a5 (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===