xref: /php-src/ext/opcache/tests/jit/bug81255.phpt (revision c16ad918)
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=function
9--FILE--
10<?php
11eval('class B {}');
12class A extends B {
13    private ?string $x = null;
14
15    public function foo($a) {
16        if (!($this->x = str_repeat($a, 5))) {
17	        throw new Exception('ops');
18        }
19        var_dump($this->x);
20        $this->x = null;
21    }
22}
23
24$a = new A;
25$a->foo('a');
26$a->foo('b');
27?>
28--EXPECT--
29string(5) "aaaaa"
30string(5) "bbbbb"
31