xref: /PHP-8.2/ext/opcache/tests/opt/sccp_019.phpt (revision e48a5c14)
1--TEST--
2SCCP 019: Array assignment
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.optimization_level=-1
7opcache.opt_debug_level=0x20000
8opcache.preload=
9zend_test.observer.enabled=0
10--EXTENSIONS--
11opcache
12--FILE--
13<?php
14function foo(int $x) {
15    $a[0] = 5;
16    $a[1] = $x;
17    $b = $a;
18    return $b[0];
19}
20?>
21--EXPECTF--
22$_main:
23     ; (lines=1, args=0, vars=0, tmps=0)
24     ; (after optimizer)
25     ; %ssccp_019.php:1-9
260000 RETURN int(1)
27
28foo:
29     ; (lines=2, args=1, vars=1, tmps=0)
30     ; (after optimizer)
31     ; %ssccp_019.php:2-7
320000 CV0($x) = RECV 1
330001 RETURN int(5)
34