3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.24 ms | 1395 KiB | 15 Q