xref: /PHP-8.1/Zend/tests/bug24635.phpt (revision f8d79582)
1--TEST--
2Bug #24635 (crash on dtor calling other functions)
3--FILE--
4<?php
5class SiteClass {
6    function __construct()	{ $this->page = new PageClass(); }
7}
8class PageClass {
9    function Display() {
10        $section = new SectionClass("PageClass::Display");
11    }
12}
13class SectionClass {
14    function __construct($comment) {
15        $this->Comment = $comment;
16    }
17    function __destruct() {
18        out($this->Comment); // this line doesn't crash PHP
19        out("\n<!-- End Section: " . $this->Comment . "-->"); // this line
20    }
21}
22function out($code) { return; }
23$site = new SiteClass();
24$site->page->Display();
25echo "OK\n";
26?>
27--EXPECT--
28OK
29