Annotation of embedaddon/php/Zend/tests/bug30725.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Bug #30725 (PHP segfaults when an exception is thrown in getIterator() within foreach)
! 3: --FILE--
! 4: <?php
! 5:
! 6: class Test implements IteratorAggregate
! 7: {
! 8: function getIterator()
! 9: {
! 10: throw new Exception();
! 11: }
! 12: }
! 13:
! 14: try
! 15: {
! 16: $it = new Test;
! 17: foreach($it as $v)
! 18: {
! 19: echo "Fail\n";
! 20: }
! 21: echo "Wrong\n";
! 22: }
! 23: catch(Exception $e)
! 24: {
! 25: echo "Caught\n";
! 26: }
! 27:
! 28: ?>
! 29: ===DONE===
! 30: --EXPECT--
! 31: Caught
! 32: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>