xref: /PHP-8.1/ext/opcache/tests/jit/array_elem.phpt (revision e9f783fc)
1--TEST--
2Refcount inference when adding array elements
3--EXTENSIONS--
4opcache
5--FILE--
6<?php
7
8function test($a) {
9    $ary = [$a];
10    $ary2 = [0, $ary, $ary];
11    return $ary2;
12}
13var_dump(test(1));
14
15?>
16--EXPECT--
17array(3) {
18  [0]=>
19  int(0)
20  [1]=>
21  array(1) {
22    [0]=>
23    int(1)
24  }
25  [2]=>
26  array(1) {
27    [0]=>
28    int(1)
29  }
30}
31