3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = Array ( "0" => 12 , "1" => 17 , "2" => 5, "3" => 27, "4" => 5 ); sort($array); //print_r($array); $arrayValues = $array; $ranked = sort($arrayValues); for($i = 0; $i < length($ranked); $i++){ for($j = 0; $j < length($arrayValues); $j++){ if($arrayValues[$i] == $sorted[$j]){ echo $arrayValues[$i] . ' has rank ' . $j; } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 28
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 11
Branch analysis from position: 33
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 22
Branch analysis from position: 22
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 13
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 33, Position 2 = 11
Branch analysis from position: 33
Branch analysis from position: 11
Branch analysis from position: 13
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 21
Branch analysis from position: 17
2 jumps found. (Code = 44) Position 1 = 27, Position 2 = 13
Branch analysis from position: 27
Branch analysis from position: 13
Branch analysis from position: 21
filename:       /in/eKvqn
function name:  (null)
number of ops:  34
compiled vars:  !0 = $array, !1 = $arrayValues, !2 = $ranked, !3 = $i, !4 = $j, !5 = $sorted
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        INIT_FCALL                                               'sort'
          2        SEND_REF                                                 !0
          3        DO_ICALL                                                 
    8     4        ASSIGN                                                   !1, !0
   10     5        INIT_FCALL                                               'sort'
          6        SEND_REF                                                 !1
          7        DO_ICALL                                         $9      
          8        ASSIGN                                                   !2, $9
   12     9        ASSIGN                                                   !3, 0
         10      > JMP                                                      ->28
   13    11    >   ASSIGN                                                   !4, 0
         12      > JMP                                                      ->22
   14    13    >   FETCH_DIM_R                                      ~13     !1, !3
         14        FETCH_DIM_R                                      ~14     !5, !4
         15        IS_EQUAL                                                 ~13, ~14
         16      > JMPZ                                                     ~15, ->21
   15    17    >   FETCH_DIM_R                                      ~16     !1, !3
         18        CONCAT                                           ~17     ~16, '+has+rank+'
         19        CONCAT                                           ~18     ~17, !4
         20        ECHO                                                     ~18
   13    21    >   PRE_INC                                                  !4
         22    >   INIT_FCALL_BY_NAME                                       'length'
         23        SEND_VAR_EX                                              !1
         24        DO_FCALL                                      0  $20     
         25        IS_SMALLER                                               !4, $20
         26      > JMPNZ                                                    ~21, ->13
   12    27    >   PRE_INC                                                  !3
         28    >   INIT_FCALL_BY_NAME                                       'length'
         29        SEND_VAR_EX                                              !2
         30        DO_FCALL                                      0  $23     
         31        IS_SMALLER                                               !3, $23
         32      > JMPNZ                                                    ~24, ->11
   18    33    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.14 ms | 1396 KiB | 15 Q