File tree Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Expand file tree Collapse file tree 2 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -215,12 +215,15 @@ static zend_always_inline zend_bool zend_ssa_is_no_val_use(const zend_op *opline
215
215
if (opline -> opcode == ZEND_ASSIGN || opline -> opcode == ZEND_UNSET_CV ) {
216
216
return ssa_op -> op1_use == var && ssa_op -> op2_use != var ;
217
217
}
218
- if (opline -> opcode == ZEND_FE_FETCH_R ) {
218
+ // TODO: Reenable this after changing the SSA structure.
219
+ /*if (opline->opcode == ZEND_FE_FETCH_R) {
219
220
return ssa_op->op2_use == var && ssa_op->op1_use != var;
220
- }
221
+ }*/
221
222
if (ssa_op -> result_use == var
222
223
&& opline -> opcode != ZEND_ADD_ARRAY_ELEMENT
223
224
&& opline -> opcode != ZEND_ADD_ARRAY_UNPACK ) {
225
+ }
226
+ if (ssa_op -> result_use == var && opline -> opcode != ZEND_ADD_ARRAY_ELEMENT ) {
224
227
return ssa_op -> op1_use != var && ssa_op -> op2_use != var ;
225
228
}
226
229
return 0 ;
Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Incorrect DCE with FE_FETCH
3
+ --INI--
4
+ opcache.enable=1
5
+ opcache.enable_cli=1
6
+ opcache.optimization_level=-1
7
+ --FILE--
8
+ <?php
9
+
10
+ function test () {
11
+ $ a = ["3 " ];
12
+ $ x = 1 ;
13
+ foreach ($ a as $ x ) {
14
+ $ x = 2.0 ;
15
+ }
16
+ var_dump ($ x );
17
+ }
18
+ test ();
19
+
20
+ ?>
21
+ --EXPECT--
22
+ float(2)
You can’t perform that action at this time.
0 commit comments