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

1.1       misho       1: --TEST--
                      2: Bug #36006 (Problem with $this in __destruct())
                      3: --FILE--
                      4: <?php
                      5: 
                      6: class Person {
                      7:        public $dad;
                      8:        public function __destruct() {
                      9:                $this->dad = null; /* no segfault if this is commented out */
                     10:        }
                     11: }
                     12: 
                     13: class Dad extends Person {
                     14:        public $son;
                     15:        public function __construct() {
                     16:                $this->son = new Person;
                     17:                $this->son->dad = $this; /* no segfault if this is commented out */
                     18:        }
                     19:        public function __destruct() {
                     20:                $this->son = null;
                     21:                parent::__destruct(); /* segfault here */
                     22:        }
                     23: }
                     24: 
                     25: $o = new Dad;
                     26: unset($o);
                     27: echo "ok\n";
                     28: ?>
                     29: --EXPECT--
                     30: ok

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