3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.71 ms | 1396 KiB | 15 Q