xref: /PHP-8.2/Zend/tests/bug54268.phpt (revision 902d6439)
1--TEST--
2Bug #54268 (Double free when destroy_zend_class fails)
3--INI--
4memory_limit=8M
5--SKIPIF--
6<?php
7$zend_mm_enabled = getenv("USE_ZEND_ALLOC");
8if ($zend_mm_enabled === "0") {
9    die("skip Zend MM disabled");
10}
11?>
12--FILE--
13<?php
14class DestructableObject
15{
16        public function __destruct()
17        {
18                DestructableObject::__destruct();
19        }
20}
21class DestructorCreator
22{
23        public $test;
24        public function __destruct()
25        {
26                $this->test = new DestructableObject;
27        }
28}
29class Test
30{
31        public static $mystatic;
32}
33$x = new Test();
34Test::$mystatic = new DestructorCreator();
35?>
36--EXPECTF--
37Fatal error: Allowed memory size of %s bytes exhausted%s(tried to allocate %s bytes) in %s on line %d
38