xref: /PHP-8.0/ext/opcache/tests/opt/dce_007.phpt (revision 7aacc705)
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=
9--SKIPIF--
10<?php require_once('skipif.inc'); ?>
11--FILE--
12<?php
13function esc($x) {
14        $a = [$x];
15        $b = [$a];
16        return $a;
17}
18?>
19--EXPECTF--
20$_main:
21     ; (lines=1, args=0, vars=0, tmps=0)
22     ; (after optimizer)
23     ; %sdce_007.php:1-8
240000 RETURN int(1)
25
26esc:
27     ; (lines=3, args=1, vars=2, tmps=0)
28     ; (after optimizer)
29     ; %sdce_007.php:2-6
300000 CV0($x) = RECV 1
310001 CV1($a) = INIT_ARRAY 1 (packed) CV0($x) NEXT
320002 RETURN CV1($a)
33