3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(1,2,3,4,5,6,7,8,9); foreach($arr as $key=>$value) { unset($arr[$key + 1]); echo $value . "\n"; echo "key=" . $key . ", value=" . $value . ", key+1=" . ($key+1) . ", arr[key+1]=" . $arr[$key + 1] . "\n\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 21
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 21
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/5auso
function name:  (null)
number of ops:  23
compiled vars:  !0 = $arr, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1      > FE_RESET_R                                       $4      !0, ->21
          2    > > FE_FETCH_R                                       ~5      $4, !1, ->21
          3    >   ASSIGN                                                   !2, ~5
    7     4        ADD                                              ~7      !2, 1
          5        UNSET_DIM                                                !0, ~7
    8     6        CONCAT                                           ~8      !1, '%0A'
          7        ECHO                                                     ~8
    9     8        CONCAT                                           ~9      'key%3D', !2
          9        CONCAT                                           ~10     ~9, '%2C+value%3D'
         10        CONCAT                                           ~11     ~10, !1
         11        CONCAT                                           ~12     ~11, '%2C+key%2B1%3D'
         12        ADD                                              ~13     !2, 1
         13        CONCAT                                           ~14     ~12, ~13
         14        CONCAT                                           ~15     ~14, '%2C+arr%5Bkey%2B1%5D%3D'
         15        ADD                                              ~16     !2, 1
         16        FETCH_DIM_R                                      ~17     !0, ~16
         17        CONCAT                                           ~18     ~15, ~17
         18        CONCAT                                           ~19     ~18, '%0A%0A'
         19        ECHO                                                     ~19
    5    20      > JMP                                                      ->2
         21    >   FE_FREE                                                  $4
   10    22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.93 ms | 1394 KiB | 13 Q