Skip to content

Commit

Permalink
Merge branch 'PHP-7.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Feb 22, 2019
2 parents 7cf177c + dda2074 commit 3cfe80d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
1 change: 1 addition & 0 deletions ext/opcache/Optimizer/dfa_pass.c
Expand Up @@ -830,6 +830,7 @@ static int zend_dfa_optimize_jmps(zend_op_array *op_array, zend_ssa *ssa)
MAKE_NOP(opline);
removed_ops++;
take_successor_1(ssa, block_num, block);
zend_ssa_remove_result_def(ssa, ssa_op);
goto optimize_nop;
}
}
Expand Down
30 changes: 30 additions & 0 deletions ext/opcache/tests/opt/jmp_001.phpt
@@ -0,0 +1,30 @@
--TEST--
JMP 001: JMP_SET with constant arg
--INI--
opcache.enable=1
opcache.enable_cli=1
opcache.optimization_level=-1
opcache.opt_debug_level=0x20000
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
function test() {
$var = null;
$var = $var ?: test2();
return $var;
}
?>
--EXPECTF--
$_main: ; (lines=1, args=0, vars=0, tmps=0)
; (after optimizer)
; %s:1-8
L0 (8): RETURN int(1)

test: ; (lines=4, args=0, vars=1, tmps=1)
; (after optimizer)
; %s:2-6
L0 (4): INIT_FCALL_BY_NAME 0 string("test2")
L1 (4): V1 = DO_FCALL_BY_NAME
L2 (4): CV0($var) = QM_ASSIGN V1
L3 (5): RETURN CV0($var)

0 comments on commit 3cfe80d

Please sign in to comment.