Annotation of embedaddon/php/Zend/tests/bug60139.phpt, revision 1.1

1.1     ! misho       1: --TEST--
        !             2: Bug #60139 (Anonymous functions create cycles not detected by the GC)
        !             3: --FILE--
        !             4: <?php
        !             5: class Foo {
        !             6:     public $x;
        !             7: 
        !             8:     public function __construct() {
        !             9:         $this->x = function() {};
        !            10:     }
        !            11: }
        !            12: 
        !            13: class Bar {
        !            14:     public $x;
        !            15: 
        !            16:     public function __construct() {
        !            17:         $self = $this;
        !            18:         $this->x = function() use ($self) {};
        !            19:     }
        !            20: }
        !            21: 
        !            22: gc_collect_cycles();
        !            23: new Foo;
        !            24: var_dump(gc_collect_cycles());
        !            25: new Bar;
        !            26: var_dump(gc_collect_cycles());
        !            27: ?>
        !            28: --EXPECT--
        !            29: int(0)
        !            30: int(2)

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