xref: /PHP-8.0/ext/opcache/tests/bug78230.phpt (revision 4892bbc1)
1--TEST--
2Bug #78230: Incorrect type check optimization
3--FILE--
4<?php
5
6function test($x) {
7    $y = (array) $x;
8    var_dump(is_array($y));
9}
10
11$ary = [1, 2];
12$ary[] = 3;
13test($ary);
14$ary[] = 4;
15var_dump($ary);
16
17?>
18--EXPECT--
19bool(true)
20array(4) {
21  [0]=>
22  int(1)
23  [1]=>
24  int(2)
25  [2]=>
26  int(3)
27  [3]=>
28  int(4)
29}
30