xref: /PHP-5.5/Zend/tests/bug68652.phpt (revision 21bb33cc)
1--TEST--
2Bug #68652 (segmentation fault in destructor)
3--FILE--
4<?php
5class Foo {
6
7    private static $instance;
8    public static function getInstance() {
9        if (isset(self::$instance)) {
10            return self::$instance;
11        }
12        return self::$instance = new self();
13    }
14
15    public function __destruct() {
16        Bar::getInstance();
17    }
18}
19
20class Bar {
21
22    private static $instance;
23    public static function getInstance() {
24        if (isset(self::$instance)) {
25            return self::$instance;
26        }
27        return self::$instance = new self();
28    }
29
30    public function __destruct() {
31        Foo::getInstance();
32    }
33}
34
35
36$foo = new Foo();
37?>
38--EXPECTF--
39Fatal error: Access to undeclared static property: Bar::$instance in %sbug68652.php on line %d
40
41