xref: /PHP-8.1/ext/opcache/tests/jit/bug81255.phpt (revision c22a4d76)
1--TEST--
2Bug #81255: Memory leak in PHPUnit with functional JIT
3--EXTENSIONS--
4opcache
5--INI--
6opcache.enable=1
7opcache.enable_cli=1
8opcache.jit_buffer_size=1M
9opcache.jit=function
10--FILE--
11<?php
12eval('class B {}');
13class A extends B {
14    private ?string $x = null;
15
16    public function foo($a) {
17        if (!($this->x = str_repeat($a, 5))) {
18	        throw new Exception('ops');
19        }
20        var_dump($this->x);
21        $this->x = null;
22    }
23}
24
25$a = new A;
26$a->foo('a');
27$a->foo('b');
28?>
29--EXPECT--
30string(5) "aaaaa"
31string(5) "bbbbb"
32