xref: /PHP-8.1/ext/opcache/tests/jit/bug81409.phpt (revision cbc925e5)
1--TEST--
2Bug #81409: Incorrect JIT code for ADD with a reference to array
3--EXTENSIONS--
4opcache
5--INI--
6opcache.enable=1
7opcache.enable_cli=1
8opcache.jit_buffer_size=1M
9opcache.jit=tracing
10--FILE--
11<?php
12function foo(&$a) {
13    $n = count($a);
14    $a = $a + [$n=>1];
15}
16function bar() {
17    $x = [];
18    for ($i = 0; $i < 200; $i++) {
19        foo($x);
20    }
21    var_dump(count($x));
22}
23bar();
24?>
25--EXPECT--
26int(200)