xref: /PHP-8.1/ext/opcache/tests/jit/assign_035.phpt (revision e9f783fc)
1--TEST--
2JIT ASSIGN: Segfault & memleak if no RC info
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_update_protection=0
7opcache.jit_buffer_size=1M
8opcache.protect_memory=1
9;opcache.jit_debug=257
10--EXTENSIONS--
11opcache
12--FILE--
13<?php
14
15class A {
16
17  public function test() {
18    $closure = function() { return "string"; };
19
20    $arr = [
21      'a' => $closure(),
22      'b' => [$closure() => [],],
23     ];
24
25    $x = $arr;
26    unset($x['b'][$closure()]['d']);
27
28    $x = $arr;
29    $x['a'] = $closure();
30
31    return "okey";
32  }
33}
34
35$a = new A();
36echo $a->test();
37?>
38--EXPECT--
39okey
40