xref: /PHP-8.1/ext/opcache/tests/opt/dce_005.phpt (revision e9f783fc)
1--TEST--
2DCE 005: Elimination of assignment to non-escaping objects (can't remove NEW yet)
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.optimization_level=-1
7opcache.opt_debug_level=0x20000
8opcache.preload=
9--EXTENSIONS--
10opcache
11--FILE--
12<?php
13class A {
14}
15function foo(int $x) {
16    $a = new A;
17    $a->foo = $x;
18}
19?>
20--EXPECTF--
21$_main:
22     ; (lines=1, args=0, vars=0, tmps=0)
23     ; (after optimizer)
24     ; %sdce_005.php:1-9
250000 RETURN int(1)
26
27foo:
28     ; (lines=2, args=1, vars=1, tmps=0)
29     ; (after optimizer)
30     ; %sdce_005.php:4-7
310000 CV0($x) = RECV 1
320001 RETURN null
33