xref: /PHP-8.0/ext/opcache/tests/jit/bug81255.phpt (revision 02acc5ad)
1--TEST--
2Bug #81255: Memory leak in PHPUnit with functional JIT
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.jit_buffer_size=1M
7opcache.jit=function
8--SKIPIF--
9<?php require_once('skipif.inc'); ?>
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