3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.9 ms | 1396 KiB | 15 Q