File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug39346.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 #39346 (Unsetting a static variable inside a destructor causes segfault later on)
    3: --FILE--
    4: <?php
    5: class test
    6: {
    7: 	protected $_id;
    8: 	static $instances;
    9: 	
   10: 	public function __construct($id) {
   11: 		$this->_id = $id;		
   12: 		self::$instances[$this->_id] = $this;
   13: 	}
   14: 	
   15: 	function __destruct() {
   16: 		unset(self::$instances[$this->_id]);
   17: 	}
   18: }
   19: $test = new test(2);
   20: $test = new test(1);
   21: $test = new test(2);
   22: $test = new test(3);
   23: echo "ok\n";
   24: ?>
   25: --EXPECT--
   26: ok

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