3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(10, 20); $n = 0; foreach($a as $k => &$v) { var_dump($v); var_dump(current($a)); if ($k > 0) { $a[] = 42;} var_dump($a); var_dump(current($a)); if ($n++ > 3) {break;} }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 3, Position 2 = 32
Branch analysis from position: 3
2 jumps found. (Code = 126) Position 1 = 4, Position 2 = 32
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 16, Position 2 = 18
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 30, Position 2 = 31
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 32
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 31
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 18
Branch analysis from position: 32
Branch analysis from position: 32
filename:       /in/AFHK7
function name:  (null)
number of ops:  34
compiled vars:  !0 = $a, !1 = $n, !2 = $v, !3 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN                                                   !1, 0
    4     2      > FE_RESET_RW                                      $6      !0, ->32
          3    > > FE_FETCH_RW                                      ~7      $6, !2, ->32
          4    >   ASSIGN                                                   !3, ~7
    5     5        INIT_FCALL                                               'var_dump'
          6        SEND_VAR                                                 !2
          7        DO_ICALL                                                 
    6     8        INIT_FCALL                                               'var_dump'
          9        INIT_FCALL                                               'current'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $10     
         12        SEND_VAR                                                 $10
         13        DO_ICALL                                                 
    7    14        IS_SMALLER                                               0, !3
         15      > JMPZ                                                     ~12, ->18
    8    16    >   ASSIGN_DIM                                               !0
         17        OP_DATA                                                  42
    9    18    >   INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
   10    21        INIT_FCALL                                               'var_dump'
         22        INIT_FCALL                                               'current'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                         $15     
         25        SEND_VAR                                                 $15
         26        DO_ICALL                                                 
   11    27        POST_INC                                         ~17     !1
         28        IS_SMALLER                                               3, ~17
         29      > JMPZ                                                     ~18, ->31
         30    > > JMP                                                      ->32
    4    31    > > JMP                                                      ->3
         32    >   FE_FREE                                                  $6
   12    33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.07 ms | 1396 KiB | 17 Q