xref: /PHP-8.2/ext/opcache/tests/jit/assign_035.phpt (revision c16ad918)
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.protect_memory=1
8;opcache.jit_debug=257
9--EXTENSIONS--
10opcache
11--FILE--
12<?php
13
14class A {
15
16  public function test() {
17    $closure = function() { return "string"; };
18
19    $arr = [
20      'a' => $closure(),
21      'b' => [$closure() => [],],
22     ];
23
24    $x = $arr;
25    unset($x['b'][$closure()]['d']);
26
27    $x = $arr;
28    $x['a'] = $closure();
29
30    return "okey";
31  }
32}
33
34$a = new A();
35echo $a->test();
36?>
37--EXPECT--
38okey
39