xref: /php-src/ext/opcache/tests/jit/bug81409.phpt (revision c16ad918)
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=tracing
9--FILE--
10<?php
11function foo(&$a) {
12    $n = count($a);
13    $a = $a + [$n=>1];
14}
15function bar() {
16    $x = [];
17    for ($i = 0; $i < 200; $i++) {
18        foo($x);
19    }
20    var_dump(count($x));
21}
22bar();
23?>
24--EXPECT--
25int(200)