xref: /PHP-8.2/ext/opcache/tests/opt/dce_007.phpt (revision e48a5c14)
1--TEST--
2DCE 007: Escaping of enclosed arrays doesn't prevent removal of enclosing array
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 esc($x) {
15        $a = [$x];
16        $b = [$a];
17        return $a;
18}
19?>
20--EXPECTF--
21$_main:
22     ; (lines=1, args=0, vars=0, tmps=0)
23     ; (after optimizer)
24     ; %sdce_007.php:1-8
250000 RETURN int(1)
26
27esc:
28     ; (lines=3, args=1, vars=2, tmps=0)
29     ; (after optimizer)
30     ; %sdce_007.php:2-6
310000 CV0($x) = RECV 1
320001 CV1($a) = INIT_ARRAY 1 (packed) CV0($x) NEXT
330002 RETURN CV1($a)
34