3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array=array('2','4','8','5','1','7','6','9','10','3'); echo "Unsorted array is: "; //show the unsorted array print_r($array); //j is 0, j is less than 10, add 1 to j if this is true. for($j = 0; $j < count($array); $j ++) { //i is 0, i is less than 10 - 1 makes it 9(?), add 1 to i if this is true for($i = 0; $i < count($array)-1; $i ++){ // if($array[$i] > $array[$i+1]) { $temp = $array[$i+1]; $array[$i+1]=$array[$i]; $array[$i]=$temp; } } } echo "Sorted Array is: "; print_r($array); ?>
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 = 32, Position 2 = 7
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 42) Position 1 = 24
Branch analysis from position: 24
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 9
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 7
Branch analysis from position: 32
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/oaRaE
function name:  (null)
number of ops:  37
compiled vars:  !0 = $array, !1 = $j, !2 = $i, !3 = $temp
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ECHO                                                     'Unsorted+array+is%3A+'
    5     2        INIT_FCALL                                               'print_r'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                                 
    8     5        ASSIGN                                                   !1, 0
          6      > JMP                                                      ->29
   10     7    >   ASSIGN                                                   !2, 0
          8      > JMP                                                      ->24
   12     9    >   FETCH_DIM_R                                      ~8      !0, !2
         10        ADD                                              ~9      !2, 1
         11        FETCH_DIM_R                                      ~10     !0, ~9
         12        IS_SMALLER                                               ~10, ~8
         13      > JMPZ                                                     ~11, ->23
   13    14    >   ADD                                              ~12     !2, 1
         15        FETCH_DIM_R                                      ~13     !0, ~12
         16        ASSIGN                                                   !3, ~13
   14    17        ADD                                              ~15     !2, 1
         18        FETCH_DIM_R                                      ~17     !0, !2
         19        ASSIGN_DIM                                               !0, ~15
         20        OP_DATA                                                  ~17
   15    21        ASSIGN_DIM                                               !0, !2
         22        OP_DATA                                                  !3
   10    23    >   PRE_INC                                                  !2
         24    >   COUNT                                            ~20     !0
         25        SUB                                              ~21     ~20, 1
         26        IS_SMALLER                                               !2, ~21
         27      > JMPNZ                                                    ~22, ->9
    8    28    >   PRE_INC                                                  !1
         29    >   COUNT                                            ~24     !0
         30        IS_SMALLER                                               !1, ~24
         31      > JMPNZ                                                    ~25, ->7
   20    32    >   ECHO                                                     'Sorted+Array+is%3A+'
   21    33        INIT_FCALL                                               'print_r'
         34        SEND_VAR                                                 !0
         35        DO_ICALL                                                 
   22    36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.54 ms | 1400 KiB | 15 Q