xref: /PHP-7.4/ext/opcache/tests/opt/sccp_001.phpt (revision 12edc453)
1--TEST--
2SCCP 001: Constant propagation
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 foo() {
14	$a = 1;
15	$b = $a + 2;
16	$a += $b;
17	return $a;
18}
19?>
20--EXPECTF--
21$_main: ; (lines=1, args=0, vars=0, tmps=0)
22    ; (after optimizer)
23    ; %ssccp_001.php:1-9
24L0 (9):     RETURN int(1)
25
26foo: ; (lines=1, args=0, vars=0, tmps=0)
27    ; (after optimizer)
28    ; %ssccp_001.php:2-7
29L0 (6):     RETURN int(4)
30