xref: /PHP-8.1/ext/opcache/tests/jit/cast_001.phpt (revision df16fd14)
1--TEST--
2JIT CAST: 001
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_update_protection=0
7opcache.jit_buffer_size=1M
8opcache.jit=1205
9;opcache.jit_debug=1
10--EXTENSIONS--
11opcache
12--FILE--
13<?php
14function foo (int $x = null) {
15    $a = (array)$x;
16    $a[] = 42;
17    var_dump($a);
18}
19foo(null);
20?>
21--EXPECT--
22array(1) {
23  [0]=>
24  int(42)
25}
26