xref: /PHP-7.4/ext/opcache/tests/opt/jmp_001.phpt (revision 66fda0cd)
1--TEST--
2JMP 001: JMP_SET with constant arg
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.optimization_level=-1
7opcache.opt_debug_level=0x20000
8--SKIPIF--
9<?php require_once('skipif.inc'); ?>
10--FILE--
11<?php
12function test() {
13    $var = null;
14    $var = $var ?: test2();
15    return $var;
16}
17?>
18--EXPECTF--
19$_main: ; (lines=1, args=0, vars=0, tmps=0)
20    ; (after optimizer)
21    ; %s:1-8
22L0 (8):     RETURN int(1)
23
24test: ; (lines=4, args=0, vars=1, tmps=1)
25    ; (after optimizer)
26    ; %s:2-6
27L0 (4):     INIT_FCALL_BY_NAME 0 string("test2")
28L1 (4):     V1 = DO_FCALL_BY_NAME
29L2 (4):     CV0($var) = QM_ASSIGN V1
30L3 (5):     RETURN CV0($var)
31