3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array("a", "b", "c", "d", "e", "f"); foreach ( $array as $key => &$value ) { echo "$key: $value\n"; if ( $value == "b" ) array_splice($array, $key, 1, array("x", "y")); } print_r($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 125) Position 1 = 2, Position 2 = 18
Branch analysis from position: 2
2 jumps found. (Code = 126) Position 1 = 3, Position 2 = 18
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 17
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 17
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 18
filename:       /in/rEQN8
function name:  (null)
number of ops:  23
compiled vars:  !0 = $array, !1 = $value, !2 = $key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1      > FE_RESET_RW                                      $4      !0, ->18
          2    > > FE_FETCH_RW                                      ~5      $4, !1, ->18
          3    >   ASSIGN                                                   !2, ~5
    5     4        ROPE_INIT                                     4  ~8      !2
          5        ROPE_ADD                                      1  ~8      ~8, '%3A+'
          6        ROPE_ADD                                      2  ~8      ~8, !1
          7        ROPE_END                                      3  ~7      ~8, '%0A'
          8        ECHO                                                     ~7
    6     9        IS_EQUAL                                                 !1, 'b'
         10      > JMPZ                                                     ~10, ->17
         11    >   INIT_FCALL                                               'array_splice'
         12        SEND_REF                                                 !0
         13        SEND_VAR                                                 !2
         14        SEND_VAL                                                 1
         15        SEND_VAL                                                 <array>
         16        DO_ICALL                                                 
    4    17    > > JMP                                                      ->2
         18    >   FE_FREE                                                  $4
    8    19        INIT_FCALL                                               'print_r'
         20        SEND_VAR                                                 !0
         21        DO_ICALL                                                 
         22      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.52 ms | 1395 KiB | 17 Q