3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.95 ms | 1392 KiB | 15 Q