xref: /PHP-8.4/ext/opcache/tests/opt/sccp_001.phpt (revision e48a5c14)
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=
9zend_test.observer.enabled=0
10--EXTENSIONS--
11opcache
12--FILE--
13<?php
14function foo() {
15    $a = 1;
16    $b = $a + 2;
17    $a += $b;
18    return $a;
19}
20?>
21--EXPECTF--
22$_main:
23     ; (lines=1, args=0, vars=0, tmps=0)
24     ; (after optimizer)
25     ; %ssccp_001.php:1-9
260000 RETURN int(1)
27
28foo:
29     ; (lines=1, args=0, vars=0, tmps=0)
30     ; (after optimizer)
31     ; %ssccp_001.php:2-7
320000 RETURN int(4)
33