3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = array(1,2,4,5,7); $zero = array(0); $length = 8; for ($i=0; $i < $length; $i++){ if ($a[$i] > $i + 1){ array_splice($a, 3, 0, $zero); } } var_dump($a);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 5
Branch analysis from position: 18
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
2 jumps found. (Code = 43) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
2 jumps found. (Code = 44) Position 1 = 18, Position 2 = 5
Branch analysis from position: 18
Branch analysis from position: 5
Branch analysis from position: 15
filename:       /in/RBRuh
function name:  (null)
number of ops:  22
compiled vars:  !0 = $a, !1 = $zero, !2 = $length, !3 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        ASSIGN                                                   !2, 8
    7     3        ASSIGN                                                   !3, 0
          4      > JMP                                                      ->16
    8     5    >   FETCH_DIM_R                                      ~8      !0, !3
          6        ADD                                              ~9      !3, 1
          7        IS_SMALLER                                               ~9, ~8
          8      > JMPZ                                                     ~10, ->15
    9     9    >   INIT_FCALL                                               'array_splice'
         10        SEND_REF                                                 !0
         11        SEND_VAL                                                 3
         12        SEND_VAL                                                 0
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
    7    15    >   PRE_INC                                                  !3
         16    >   IS_SMALLER                                               !3, !2
         17      > JMPNZ                                                    ~13, ->5
   13    18    >   INIT_FCALL                                               'var_dump'
         19        SEND_VAR                                                 !0
         20        DO_ICALL                                                 
         21      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.92 ms | 1395 KiB | 17 Q