Annotation of embedaddon/php/ext/spl/tests/bug52238.phpt, revision 1.1.1.2

1.1       misho       1: --TEST--
1.1.1.2 ! misho       2: Bug #52238 - Crash when an Exception occurred in iterator_to_array
1.1       misho       3: --FILE--
                      4: <?php
                      5: class Foo implements IteratorAggregate
                      6: {
                      7:     public function bar() {
                      8:         throw new Exception;
                      9:     }
                     10:                                                
                     11:     public function getIterator() {
                     12:         return new ArrayIterator($this->bar());
                     13:     }
                     14: }
                     15: var_dump(iterator_to_array(new Foo));
                     16: ?>
                     17: --EXPECTF--
                     18: Fatal error: Uncaught exception 'Exception' in %s
                     19: Stack trace:
                     20: #0 %s: Foo->bar()
                     21: #1 [internal function]: Foo->getIterator()
                     22: #2 %s: iterator_to_array(Object(Foo))
                     23: #3 {main}
                     24:   thrown in %s on line %d

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>