File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug47343.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, 10 months 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 #47343 (gc_collect_cycles causes a segfault when called within a destructor in one case)
    3: --FILE--
    4: <?php
    5: class A
    6: {
    7: 	public function __destruct()
    8: 	{
    9: 		gc_collect_cycles();
   10: 	}
   11: 	
   12: 	public function getB()
   13: 	{
   14: 		$this->data['foo'] = new B($this);
   15: 		$this->data['bar'] = new B($this);
   16: 		// Return either of the above
   17: 		return $this->data['foo'];
   18: 	}
   19: }
   20: 
   21: class B
   22: {
   23: 	public function B($A)
   24: 	{
   25: 		$this->A = $A;
   26: 	}
   27: 
   28: 	public function __destruct()
   29: 	{
   30: 	}
   31: }
   32: 
   33: for ($i = 0; $i < 2; $i++)
   34: {
   35: 	$Aobj = new A;
   36: 	$Bobj = $Aobj->getB();
   37: 	unset($Bobj);
   38: 	unset($Aobj);
   39: }
   40: 
   41: echo "DONE\n";
   42: ?>
   43: --EXPECT--
   44: DONE

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