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