Skip to content

Commit 3cfe80d

Browse files
committed
Merge branch 'PHP-7.4'
2 parents 7cf177c + dda2074 commit 3cfe80d

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

ext/opcache/Optimizer/dfa_pass.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -830,6 +830,7 @@ static int zend_dfa_optimize_jmps(zend_op_array *op_array, zend_ssa *ssa)
830830
MAKE_NOP(opline);
831831
removed_ops++;
832832
take_successor_1(ssa, block_num, block);
833+
zend_ssa_remove_result_def(ssa, ssa_op);
833834
goto optimize_nop;
834835
}
835836
}

ext/opcache/tests/opt/jmp_001.phpt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--TEST--
2+
JMP 001: JMP_SET with constant arg
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.optimization_level=-1
7+
opcache.opt_debug_level=0x20000
8+
--SKIPIF--
9+
<?php require_once('skipif.inc'); ?>
10+
--FILE--
11+
<?php
12+
function 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
22+
L0 (8): RETURN int(1)
23+
24+
test: ; (lines=4, args=0, vars=1, tmps=1)
25+
; (after optimizer)
26+
; %s:2-6
27+
L0 (4): INIT_FCALL_BY_NAME 0 string("test2")
28+
L1 (4): V1 = DO_FCALL_BY_NAME
29+
L2 (4): CV0($var) = QM_ASSIGN V1
30+
L3 (5): RETURN CV0($var)

0 commit comments

Comments
 (0)