3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.28 ms | 1395 KiB | 17 Q