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: "; echo "<br />"; //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 "<br>"; echo "Sorted Array is: "; echo "<br />"; print_r($array); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 30
Branch analysis from position: 30
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 8
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 10
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 8
Branch analysis from position: 33
Branch analysis from position: 8
Branch analysis from position: 10
2 jumps found. (Code = 43) Position 1 = 15, Position 2 = 24
Branch analysis from position: 15
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 10
Branch analysis from position: 29
Branch analysis from position: 10
Branch analysis from position: 24
filename:       /in/Nl2KJ
function name:  (null)
number of ops:  40
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+'
    4     2        ECHO                                                     '%3Cbr+%2F%3E'
    6     3        INIT_FCALL                                               'print_r'
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                                 
    9     6        ASSIGN                                                   !1, 0
          7      > JMP                                                      ->30
   11     8    >   ASSIGN                                                   !2, 0
          9      > JMP                                                      ->25
   13    10    >   FETCH_DIM_R                                      ~8      !0, !2
         11        ADD                                              ~9      !2, 1
         12        FETCH_DIM_R                                      ~10     !0, ~9
         13        IS_SMALLER                                               ~10, ~8
         14      > JMPZ                                                     ~11, ->24
   14    15    >   ADD                                              ~12     !2, 1
         16        FETCH_DIM_R                                      ~13     !0, ~12
         17        ASSIGN                                                   !3, ~13
   15    18        ADD                                              ~15     !2, 1
         19        FETCH_DIM_R                                      ~17     !0, !2
         20        ASSIGN_DIM                                               !0, ~15
         21        OP_DATA                                                  ~17
   16    22        ASSIGN_DIM                                               !0, !2
         23        OP_DATA                                                  !3
   11    24    >   PRE_INC                                                  !2
         25    >   COUNT                                            ~20     !0
         26        SUB                                              ~21     ~20, 1
         27        IS_SMALLER                                               !2, ~21
         28      > JMPNZ                                                    ~22, ->10
    9    29    >   PRE_INC                                                  !1
         30    >   COUNT                                            ~24     !0
         31        IS_SMALLER                                               !1, ~24
         32      > JMPNZ                                                    ~25, ->8
   20    33    >   ECHO                                                     '%3Cbr%3E'
   21    34        ECHO                                                     'Sorted+Array+is%3A+'
   22    35        ECHO                                                     '%3Cbr+%2F%3E'
   23    36        INIT_FCALL                                               'print_r'
         37        SEND_VAR                                                 !0
         38        DO_ICALL                                                 
   24    39      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
153.44 ms | 1400 KiB | 15 Q