xref: /PHP-8.1/ext/opcache/tests/opt/dce_003.phpt (revision e9f783fc)
1--TEST--
2DCE 003: Assignment elimination (without FREE)
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
13function foo(int $a) {
14    $b = $a += 3;
15    return $a;
16}
17?>
18--EXPECTF--
19$_main:
20     ; (lines=1, args=0, vars=0, tmps=0)
21     ; (after optimizer)
22     ; %sdce_003.php:1-7
230000 RETURN int(1)
24
25foo:
26     ; (lines=3, args=1, vars=1, tmps=0)
27     ; (after optimizer)
28     ; %sdce_003.php:2-5
290000 CV0($a) = RECV 1
300001 CV0($a) = ADD CV0($a) int(3)
310002 RETURN CV0($a)
32