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); array_pop($top30); break; } } var_dump($top30); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 17
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 3
Branch analysis from position: 20
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 43) Position 1 = 6, Position 2 = 16
Branch analysis from position: 6
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
Branch analysis from position: 16
2 jumps found. (Code = 44) Position 1 = 20, Position 2 = 3
Branch analysis from position: 20
Branch analysis from position: 3
filename:       /in/ATk2L
function name:  (null)
number of ops:  24
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                                                      ->17
    5     3    >   FETCH_DIM_R                                      ~4      !0, !1
          4        IS_SMALLER                                               ~4, 5
          5      > JMPZ                                                     ~5, ->16
    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        INIT_FCALL                                               'array_pop'
         13        SEND_REF                                                 !0
         14        DO_ICALL                                                 
    8    15      > JMP                                                      ->20
    4    16    >   PRE_INC                                                  !1
         17    >   COUNT                                            ~9      !0
         18        IS_SMALLER                                               !1, ~9
         19      > JMPNZ                                                    ~10, ->3
   11    20    >   INIT_FCALL                                               'var_dump'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                                 
   13    23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
186.98 ms | 1395 KiB | 19 Q