Annotation of embedaddon/php/Zend/tests/gc_030.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: GC 030: GC and exceptions in destructors
! 3: --INI--
! 4: zend.enable_gc=1
! 5: --FILE--
! 6: <?php
! 7: class foo {
! 8: public $foo;
! 9:
! 10: public function __destruct() {
! 11: throw new Exception("foobar");
! 12: }
! 13: }
! 14:
! 15: $f1 = new foo;
! 16: $f2 = new foo;
! 17: $f1->foo = $f2;
! 18: $f2->foo = $f1;
! 19: unset($f1, $f2);
! 20: gc_collect_cycles();
! 21: ?>
! 22: --EXPECTF--
! 23: Fatal error: Uncaught exception 'Exception' with message 'foobar' in %sgc_030.php:%d
! 24: Stack trace:
! 25: #0 [internal function]: foo->__destruct()
! 26: #1 %sgc_030.php(%d): gc_collect_cycles()
! 27: #2 {main}
! 28:
! 29: Next exception 'Exception' with message 'foobar' in %sgc_030.php:%d
! 30: Stack trace:
! 31: #0 %sgc_030.php(%d): foo->__destruct()
! 32: #1 {main}
! 33: thrown in %sgc_030.php on line %d
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>