File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,13 @@ function test() {
6
6
$ a [X] ??= Y;
7
7
var_dump ($ a );
8
8
}
9
+ function test2 (string $ b , int $ c ) {
10
+ $ a [~$ b ] ??= $ c ;
11
+ }
9
12
define ('X ' , 1 );
10
13
define ('Y ' , 2 );
11
14
test ();
15
+ test2 ("" , 0 );
12
16
?>
13
17
--EXPECT--
14
18
array(1) {
Original file line number Diff line number Diff line change @@ -729,6 +729,7 @@ static void emit_live_range(
729
729
if (use_opline -> opcode != ZEND_FREE ) {
730
730
/* This can happen if one branch of the coalesce has been optimized away.
731
731
* In this case we should emit a normal live-range instead. */
732
+ start ++ ;
732
733
break ;
733
734
}
734
735
@@ -744,6 +745,12 @@ static void emit_live_range(
744
745
745
746
do {
746
747
use_opline -- ;
748
+
749
+ /* The use might have been optimized away, in which case we will hit the def
750
+ * instead. */
751
+ if (use_opline -> opcode == ZEND_COPY_TMP && use_opline -> result .var == rt_var_num ) {
752
+ return ;
753
+ }
747
754
} while (!(
748
755
((use_opline -> op1_type & (IS_TMP_VAR |IS_VAR )) && use_opline -> op1 .var == rt_var_num ) ||
749
756
((use_opline -> op2_type & (IS_TMP_VAR |IS_VAR )) && use_opline -> op2 .var == rt_var_num )
You can’t perform that action at this time.
0 commit comments