3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = []; $a[1] = 1; foreach ($a as $k => &$v) { var_dump($v); if ($k == 1) $a[4] = 4; if ($k == 4) $a[2] = 2; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 4, Position 2 = 18
Branch analysis from position: 4
2 jumps found. (Code = 126) Position 1 = 5, Position 2 = 18
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 13
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 17
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 17
Branch analysis from position: 13
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/OAKNO
function name:  (null)
number of ops:  20
compiled vars:  !0 = $a, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN_DIM                                               !0, 1
          2        OP_DATA                                                  1
    4     3      > FE_RESET_RW                                      $5      !0, ->18
          4    > > FE_FETCH_RW                                      ~6      $5, !1, ->18
          5    >   ASSIGN                                                   !2, ~6
    5     6        INIT_FCALL                                               'var_dump'
          7        SEND_VAR                                                 !1
          8        DO_ICALL                                                 
    6     9        IS_EQUAL                                                 !2, 1
         10      > JMPZ                                                     ~9, ->13
         11    >   ASSIGN_DIM                                               !0, 4
         12        OP_DATA                                                  4
    7    13    >   IS_EQUAL                                                 !2, 4
         14      > JMPZ                                                     ~11, ->17
         15    >   ASSIGN_DIM                                               !0, 2
         16        OP_DATA                                                  2
    4    17    > > JMP                                                      ->4
         18    >   FE_FREE                                                  $5
    8    19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
185.01 ms | 1395 KiB | 15 Q