xref: /PHP-8.2/Zend/tests/bug63305.phpt (revision 162aa1a5)
1--TEST--
2Bug #63305 (zend_mm_heap corrupted with traits)
3--FILE--
4<?php
5
6spl_autoload_register(function ($class) {
7    switch ($class) {
8    case "Attachment":
9        eval(<<<'PHP'
10class Attachment extends File {
11}
12PHP
13    );
14        break;
15    case "File":
16        eval(<<<'PHP'
17class File {
18    use TDatabaseObject {
19        TDatabaseObject::__construct as private databaseObjectConstruct;
20    }
21    public function __construct() {
22    }
23}
24PHP
25    );
26        break;
27    case "TDatabaseObject":
28        eval(<<<'PHP'
29trait TDatabaseObject {
30    public function __construct() {
31    }
32}
33PHP
34    );
35        break;
36    }
37    return TRUE;
38});
39
40new Attachment("");
41echo "okey";
42?>
43--EXPECT--
44okey
45