xref: /PHP-8.4/ext/opcache/tests/jit/gh17246.phpt (revision df6db275)
1--TEST--
2GH-17246 (Nested shm protections cause segfault)
3--EXTENSIONS--
4opcache
5--INI--
6opcache.protect_memory=1
7opcache.jit_buffer_size=32M
8opcache.jit=1254
9--FILE--
10<?php
11
12class Test
13{
14    private $field;
15
16    public function __construct()
17    {
18        $this->field = function() {};
19    }
20
21    public function __destruct()
22    {
23        // Necessary because we need to invoke tracing JIT during destruction
24    }
25}
26
27for ($i = 0; $i < 10000; ++$i) {
28    $obj = new Test();
29}
30
31require __DIR__.'/gh17246.inc';
32
33?>
34--EXPECTF--
35Fatal error: Uncaught Error: Class "NonExistentClass" not found in %s:%d
36Stack trace:
37#0 %s(%d): require()
38#1 {main}
39  thrown in %s on line %d
40