Annotation of embedaddon/php/Zend/tests/bug63635.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Bug #63635 (Segfault in gc_collect_cycles)
                      3: --FILE--
                      4: <?php
                      5: class Node {
                      6:        public $parent = NULL;
                      7:        public $childs = array();
                      8:        
                      9:        function __construct(Node $parent=NULL) {
                     10:                if ($parent) {
                     11:                        $parent->childs[] = $this;
                     12:                }
                     13:                $this->childs[] = $this;
                     14:        }
                     15:        
                     16:        function __destruct() {
                     17:                $this->childs = NULL;
                     18:        }       
                     19: }
                     20: 
                     21: define("MAX", 16);
                     22: 
                     23: for ($n = 0; $n < 20; $n++) {
                     24:        $top = new Node();
                     25:        for ($i=0 ; $i<MAX ; $i++) {
                     26:                $ci = new Node($top);
                     27:                for ($j=0 ; $j<MAX ; $j++) {
                     28:                        $cj = new Node($ci);
                     29:                        for ($k=0 ; $k<MAX ; $k++) {
                     30:                                $ck = new Node($cj);
                     31:                        }
                     32:                }
                     33:        }
                     34:        echo "$n\n";
                     35: }
                     36: echo "ok\n";
                     37: --EXPECT--
                     38: 0
                     39: 1
                     40: 2
                     41: 3
                     42: 4
                     43: 5
                     44: 6
                     45: 7
                     46: 8
                     47: 9
                     48: 10
                     49: 11
                     50: 12
                     51: 13
                     52: 14
                     53: 15
                     54: 16
                     55: 17
                     56: 18
                     57: 19
                     58: ok

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