3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = array(1, 2, 3, 4, 5); $arr2 = array('a', 'b', 'c', 'd'); $ref = &$arr1; foreach($ref AS $key=>$val) { echo "$key => $val \r\n"; if( $val === 5) { $ref = $arr2; } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 15
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 15
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 14
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/HeUXe
function name:  (null)
number of ops:  17
compiled vars:  !0 = $arr1, !1 = $arr2, !2 = $ref, !3 = $val, !4 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    6     2        ASSIGN_REF                                               !2, !0
    8     3      > FE_RESET_R                                       $8      !2, ->15
          4    > > FE_FETCH_R                                       ~9      $8, !3, ->15
          5    >   ASSIGN                                                   !4, ~9
    9     6        ROPE_INIT                                     4  ~12     !4
          7        ROPE_ADD                                      1  ~12     ~12, '+%3D%3E+'
          8        ROPE_ADD                                      2  ~12     ~12, !3
          9        ROPE_END                                      3  ~11     ~12, '+%0D%0A'
         10        ECHO                                                     ~11
   10    11        IS_IDENTICAL                                             !3, 5
         12      > JMPZ                                                     ~14, ->14
   11    13    >   ASSIGN                                                   !2, !1
    8    14    > > JMP                                                      ->4
         15    >   FE_FREE                                                  $8
   13    16      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.49 ms | 938 KiB | 14 Q