3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.89 ms | 1396 KiB | 15 Q