summaryrefslogtreecommitdiff
path: root/Zend/tests/bug51822.phpt
blob: cffae7bb1a5faf1aa13632144e881222b1b14bea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
--TEST--
Bug #51822 (Segfault with strange __destruct() for static class variables)
--FILE--
<?php
class DestructableObject
{
	public function __destruct()
	{
		echo "2\n";
	}	
}

class DestructorCreator
{
	public function __destruct()
	{
		$this->test = new DestructableObject;	
		echo "1\n";
	}
}

class Test
{
	public static $mystatic;
}

// Uncomment this to avoid segfault
//Test::$mystatic = new DestructorCreator();

$x = new Test();

if (!isset(Test::$mystatic))
	Test::$mystatic = new DestructorCreator();

echo "bla\n";
?>
--EXPECT--
bla
1
2