This commit was manufactured by cvs2svn to create branch 'PHP_5_0'.
authorSVN Migration <svn@php.net>
Mon, 24 Jan 2005 19:16:07 +0000 (19:16 +0000)
committerSVN Migration <svn@php.net>
Mon, 24 Jan 2005 19:16:07 +0000 (19:16 +0000)
Zend/tests/bug30725.phpt [new file with mode: 0755]

diff --git a/Zend/tests/bug30725.phpt b/Zend/tests/bug30725.phpt
new file mode 100755 (executable)
index 0000000..511ab81
--- /dev/null
@@ -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===