3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = array(); $x["0"] = "foo"; $x["1"] = "bar"; foreach ($x as $k => $v) { var_dump($k); var_dump($v); } echo "-----------\r\n"; $x["3"] = "baz"; foreach ($x as $k => $v) { var_dump($k); var_dump($v); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 6, Position 2 = 15
Branch analysis from position: 6
2 jumps found. (Code = 78) Position 1 = 7, Position 2 = 15
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 15
2 jumps found. (Code = 77) Position 1 = 20, Position 2 = 29
Branch analysis from position: 20
2 jumps found. (Code = 78) Position 1 = 21, Position 2 = 29
Branch analysis from position: 21
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
Branch analysis from position: 15
filename:       /in/8rWv0
function name:  (null)
number of ops:  31
compiled vars:  !0 = $x, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN_DIM                                               !0, 0
          2        OP_DATA                                                  'foo'
    4     3        ASSIGN_DIM                                               !0, 1
          4        OP_DATA                                                  'bar'
    6     5      > FE_RESET_R                                       $6      !0, ->15
          6    > > FE_FETCH_R                                       ~7      $6, !1, ->15
          7    >   ASSIGN                                                   !2, ~7
    7     8        INIT_FCALL                                               'var_dump'
          9        SEND_VAR                                                 !2
         10        DO_ICALL                                                 
    8    11        INIT_FCALL                                               'var_dump'
         12        SEND_VAR                                                 !1
         13        DO_ICALL                                                 
    6    14      > JMP                                                      ->6
         15    >   FE_FREE                                                  $6
   11    16        ECHO                                                     '-----------%0D%0A'
   13    17        ASSIGN_DIM                                               !0, 3
         18        OP_DATA                                                  'baz'
   15    19      > FE_RESET_R                                       $12     !0, ->29
         20    > > FE_FETCH_R                                       ~13     $12, !1, ->29
         21    >   ASSIGN                                                   !2, ~13
   16    22        INIT_FCALL                                               'var_dump'
         23        SEND_VAR                                                 !2
         24        DO_ICALL                                                 
   17    25        INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                                 
   15    28      > JMP                                                      ->20
         29    >   FE_FREE                                                  $12
   18    30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.76 ms | 1396 KiB | 15 Q