3v4l.org

run code in 500+ PHP versions simultaneously
<?php $ar = [1,2,3,4,5]; $i = new ArrayIterator($ar); foreach ($i as $k => $e) { var_dump($e); if ($k === 1) { unset($i[$k]); } } echo '---------' . PHP_EOL; foreach ($i as $e) { var_dump($e); }
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
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 14
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 6
Branch analysis from position: 6
Branch analysis from position: 14
Branch analysis from position: 15
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
Branch analysis from position: 15
filename:       /in/uUoaH
function name:  (null)
number of ops:  25
compiled vars:  !0 = $ar, !1 = $i, !2 = $e, !3 = $k
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
    4     1        NEW                                                  $5      'ArrayIterator'
          2        SEND_VAR_EX                                                  !0
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !1, $5
    6     5      > FE_RESET_R                                           $8      !1, ->15
          6    > > FE_FETCH_R                                           ~9      $8, !2, ->15
          7    >   ASSIGN                                                       !3, ~9
    7     8        INIT_FCALL                                                   'var_dump'
          9        SEND_VAR                                                     !2
         10        DO_ICALL                                                     
    8    11        IS_IDENTICAL                                                 !3, 1
         12      > JMPZ                                                         ~12, ->14
    9    13    >   UNSET_DIM                                                    !1, !3
    6    14    > > JMP                                                          ->6
         15    >   FE_FREE                                                      $8
   13    16        ECHO                                                         '---------%0A'
   15    17      > FE_RESET_R                                           $13     !1, ->23
         18    > > FE_FETCH_R                                                   $13, !2, ->23
   16    19    >   INIT_FCALL                                                   'var_dump'
         20        SEND_VAR                                                     !2
         21        DO_ICALL                                                     
   15    22      > JMP                                                          ->18
         23    >   FE_FREE                                                      $13
   17    24      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
167.17 ms | 2950 KiB | 14 Q