File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,13 @@ function test() {
66 $ a [X] ??= Y;
77 var_dump ($ a );
88}
9+ function test2 (string $ b , int $ c ) {
10+ $ a [~$ b ] ??= $ c ;
11+ }
912define ('X ' , 1 );
1013define ('Y ' , 2 );
1114test ();
15+ test2 ("" , 0 );
1216?>
1317--EXPECT--
1418array(1) {
Original file line number Diff line number Diff line change @@ -729,6 +729,7 @@ static void emit_live_range(
729729 if (use_opline -> opcode != ZEND_FREE ) {
730730 /* This can happen if one branch of the coalesce has been optimized away.
731731 * In this case we should emit a normal live-range instead. */
732+ start ++ ;
732733 break ;
733734 }
734735
@@ -744,6 +745,12 @@ static void emit_live_range(
744745
745746 do {
746747 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+ }
747754 } while (!(
748755 ((use_opline -> op1_type & (IS_TMP_VAR |IS_VAR )) && use_opline -> op1 .var == rt_var_num ) ||
749756 ((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