3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [8, 3, 5, 2, 9]; for($i = 1; $i < count($arr); $i++) { $key = $arr[$i]; $j = $i - 1; if( $j >= 0 && $arr[$i] < $arr[$j]) { $arr[$j + 1] = $arr[$j]; $j--; } $arr[$j + 1] = $key; } print_r($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 3
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 3
2 jumps found. (Code = 46) Position 1 = 9, Position 2 = 13
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 14, Position 2 = 19
Branch analysis from position: 14
2 jumps found. (Code = 44) Position 1 = 26, Position 2 = 3
Branch analysis from position: 26
Branch analysis from position: 3
Branch analysis from position: 19
Branch analysis from position: 13
filename:       /in/IKRDu
function name:  (null)
number of ops:  30
compiled vars:  !0 = $arr, !1 = $i, !2 = $key, !3 = $j
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 1
          2      > JMP                                                      ->23
    6     3    >   FETCH_DIM_R                                      ~6      !0, !1
          4        ASSIGN                                                   !2, ~6
    7     5        SUB                                              ~8      !1, 1
          6        ASSIGN                                                   !3, ~8
    9     7        IS_SMALLER_OR_EQUAL                              ~10     0, !3
          8      > JMPZ_EX                                          ~10     ~10, ->13
          9    >   FETCH_DIM_R                                      ~11     !0, !1
         10        FETCH_DIM_R                                      ~12     !0, !3
         11        IS_SMALLER                                       ~13     ~11, ~12
         12        BOOL                                             ~10     ~13
         13    > > JMPZ                                                     ~10, ->19
   10    14    >   ADD                                              ~14     !3, 1
         15        FETCH_DIM_R                                      ~16     !0, !3
         16        ASSIGN_DIM                                               !0, ~14
         17        OP_DATA                                                  ~16
   11    18        PRE_DEC                                                  !3
   13    19    >   ADD                                              ~18     !3, 1
         20        ASSIGN_DIM                                               !0, ~18
         21        OP_DATA                                                  !2
    5    22        PRE_INC                                                  !1
         23    >   COUNT                                            ~21     !0
         24        IS_SMALLER                                               !1, ~21
         25      > JMPNZ                                                    ~22, ->3
   16    26    >   INIT_FCALL                                               'print_r'
         27        SEND_VAR                                                 !0
         28        DO_ICALL                                                 
         29      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
141.47 ms | 1014 KiB | 14 Q