3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = new ArrayObject(['a' => 1, 'b' => 2, 'c' => 3]); foreach (new ArrayObject($a) as $k => $v) { var_dump($v); if ($k === 'a') { unset($a['a']); } }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 17
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 17
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 16
Branch analysis from position: 15
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 16
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/H1c98
function name:  (null)
number of ops:  19
compiled vars:  !0 = $a, !1 = $v, !2 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $3      'ArrayObject'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $3
    5     4        NEW                                              $6      'ArrayObject'
          5        SEND_VAR_EX                                              !0
          6        DO_FCALL                                      0          
          7      > FE_RESET_R                                       $8      $6, ->17
          8    > > FE_FETCH_R                                       ~9      $8, !1, ->17
          9    >   ASSIGN                                                   !2, ~9
    6    10        INIT_FCALL                                               'var_dump'
         11        SEND_VAR                                                 !1
         12        DO_ICALL                                                 
    7    13        IS_IDENTICAL                                             !2, 'a'
         14      > JMPZ                                                     ~12, ->16
    8    15    >   UNSET_DIM                                                !0, 'a'
    5    16    > > JMP                                                      ->8
         17    >   FE_FREE                                                  $8
   10    18      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.87 ms | 1009 KiB | 14 Q