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 < sizeof($ranked); $i++){ for($j = 0; $j < sizeof($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 = 29
Branch analysis from position: 29
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 14
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 16
Branch analysis from position: 28
2 jumps found. (Code = 44) Position 1 = 32, Position 2 = 14
Branch analysis from position: 32
Branch analysis from position: 14
Branch analysis from position: 16
2 jumps found. (Code = 43) Position 1 = 20, Position 2 = 24
Branch analysis from position: 20
2 jumps found. (Code = 44) Position 1 = 28, Position 2 = 16
Branch analysis from position: 28
Branch analysis from position: 16
Branch analysis from position: 24
filename:       /in/hMoRP
function name:  (null)
number of ops:  33
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                                                 
    6     4        INIT_FCALL                                               'print_r'
          5        SEND_VAR                                                 !0
          6        DO_ICALL                                                 
    8     7        ASSIGN                                                   !1, !0
   10     8        INIT_FCALL                                               'sort'
          9        SEND_REF                                                 !1
         10        DO_ICALL                                         $10     
         11        ASSIGN                                                   !2, $10
   12    12        ASSIGN                                                   !3, 0
         13      > JMP                                                      ->29
   13    14    >   ASSIGN                                                   !4, 0
         15      > JMP                                                      ->25
   14    16    >   FETCH_DIM_R                                      ~14     !1, !3
         17        FETCH_DIM_R                                      ~15     !5, !4
         18        IS_EQUAL                                                 ~14, ~15
         19      > JMPZ                                                     ~16, ->24
   15    20    >   FETCH_DIM_R                                      ~17     !1, !3
         21        CONCAT                                           ~18     ~17, '+has+rank+'
         22        CONCAT                                           ~19     ~18, !4
         23        ECHO                                                     ~19
   13    24    >   PRE_INC                                                  !4
         25    >   COUNT                                            ~21     !1
         26        IS_SMALLER                                               !4, ~21
         27      > JMPNZ                                                    ~22, ->16
   12    28    >   PRE_INC                                                  !3
         29    >   COUNT                                            ~24     !2
         30        IS_SMALLER                                               !3, ~24
         31      > JMPNZ                                                    ~25, ->14
   18    32    > > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
175.91 ms | 1396 KiB | 17 Q