xref: /PHP-7.0/Zend/tests/bug69446_2.phpt (revision 00445ba2)
1--TEST--
2Bug #69446 (GC leak relating to removal of nested data after dtors run)
3--FILE--
4<?php
5$bar = NULL;
6class bad
7{
8	public $_private = array();
9
10	public function __construct()
11	{
12		$this->_private[] = 'php';
13	}
14
15	public function __destruct()
16	{
17		global $bar;
18		$bar = $this;
19	}
20}
21
22$foo = new stdclass;
23$foo->foo = $foo;
24$foo->bad = new bad;
25
26unserialize(serialize($foo));
27//unset($foo);
28
29gc_collect_cycles();
30var_dump($bar);
31--EXPECT--
32object(bad)#4 (1) {
33  ["_private"]=>
34  array(1) {
35    [0]=>
36    string(3) "php"
37  }
38}
39