3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.41 ms | 1014 KiB | 14 Q