File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug36006.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 23:47:52 2012 UTC (13 years, 1 month ago) by misho
Branches: php, MAIN
CVS tags: v5_4_3elwix, v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17p0, v5_4_17, v5_3_10, HEAD
php

    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>