3v4l.org

run code in 300+ PHP versions simultaneously
<?php $x = [0,1,2]; foreach ($x as $k => &$v) { print $k; if ($k == 0) { unset($x[1]); } foreach ($x as $y) { } } $a = [0,1,2]; foreach ($a as $k1 => $v1) { print $k1; if ($k1 == 0) { unset($a[1]); } foreach ($a as $b) { } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 2, Position 2 = 13
Branch analysis from position: 2
2 jumps found. (Code = 126) Position 1 = 3, Position 2 = 13
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 7, Position 2 = 8
Branch analysis from position: 7
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 11
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 11
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 11
Branch analysis from position: 8
Branch analysis from position: 13
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 27
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 27
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 21, Position 2 = 22
Branch analysis from position: 21
2 jumps found. (Code = 77) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
2 jumps found. (Code = 78) Position 1 = 24, Position 2 = 25
Branch analysis from position: 24
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 25
Branch analysis from position: 22
Branch analysis from position: 27
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 27
Branch analysis from position: 13
filename:       /in/81rl8
function name:  (null)
number of ops:  29
compiled vars:  !0 = $x, !1 = $v, !2 = $k, !3 = $y, !4 = $a, !5 = $v1, !6 = $k1, !7 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1      > FE_RESET_RW                                      $9      !0, ->13
          2    > > FE_FETCH_RW                                      ~10     $9, !1, ->13
          3    >   ASSIGN                                                   !2, ~10
    5     4        ECHO                                                     !2
    6     5        IS_EQUAL                                                 !2, 0
          6      > JMPZ                                                     ~12, ->8
    7     7    >   UNSET_DIM                                                !0, 1
    9     8    > > FE_RESET_R                                       $13     !0, ->11
          9    > > FE_FETCH_R                                               $13, !3, ->11
         10    > > JMP                                                      ->9
         11    >   FE_FREE                                                  $13
    4    12      > JMP                                                      ->2
         13    >   FE_FREE                                                  $9
   12    14        ASSIGN                                                   !4, <array>
   13    15      > FE_RESET_R                                       $15     !4, ->27
         16    > > FE_FETCH_R                                       ~16     $15, !5, ->27
         17    >   ASSIGN                                                   !6, ~16
   14    18        ECHO                                                     !6
   15    19        IS_EQUAL                                                 !6, 0
         20      > JMPZ                                                     ~18, ->22
   16    21    >   UNSET_DIM                                                !4, 1
   18    22    > > FE_RESET_R                                       $19     !4, ->25
         23    > > FE_FETCH_R                                               $19, !7, ->25
         24    > > JMP                                                      ->23
         25    >   FE_FREE                                                  $19
   13    26      > JMP                                                      ->16
         27    >   FE_FREE                                                  $15
   19    28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
126.99 ms | 1447 KiB | 13 Q