3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "without reference\n"; $array = [0, 1, 2]; foreach ($array as $val) { var_dump(current($array)); } echo "\nwith reference\n"; $array = [0, 1, 2]; foreach ($array as &$val) { var_dump(current($array)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 11
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 11
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 11
2 jumps found. (Code = 125) Position 1 = 15, Position 2 = 23
Branch analysis from position: 15
2 jumps found. (Code = 126) Position 1 = 16, Position 2 = 23
Branch analysis from position: 16
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
Branch analysis from position: 11
filename:       /in/llSMd
function name:  (null)
number of ops:  25
compiled vars:  !0 = $array, !1 = $val
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ECHO                                                     'without+reference%0A'
    3     1        ASSIGN                                                   !0, <array>
    4     2      > FE_RESET_R                                       $3      !0, ->11
          3    > > FE_FETCH_R                                               $3, !1, ->11
    5     4    >   INIT_FCALL                                               'var_dump'
          5        INIT_FCALL                                               'current'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $4      
          8        SEND_VAR                                                 $4
          9        DO_ICALL                                                 
    4    10      > JMP                                                      ->3
         11    >   FE_FREE                                                  $3
    8    12        ECHO                                                     '%0Awith+reference%0A'
    9    13        ASSIGN                                                   !0, <array>
   10    14      > FE_RESET_RW                                      $7      !0, ->23
         15    > > FE_FETCH_RW                                              $7, !1, ->23
   11    16    >   INIT_FCALL                                               'var_dump'
         17        INIT_FCALL                                               'current'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                         $8      
         20        SEND_VAR                                                 $8
         21        DO_ICALL                                                 
   10    22      > JMP                                                      ->15
         23    >   FE_FREE                                                  $7
   12    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
182.28 ms | 1396 KiB | 17 Q