3v4l.org

run code in 300+ PHP versions simultaneously
<?php $values = array(); $values[0] = 5; $values[1] = 12; $values[2] = 19; $values[3] = 9; $values[4] = 5; $ordered_values = $values; rsort($ordered_values); foreach ($values as $key => $value) { foreach ($ordered_values as $ordered_key => $ordered_value) { if ($value === $ordered_value) { $key = $ordered_key; break; } } echo $value . '- Rank: ' . ((int) $key + 1) . '<br/>'; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 34
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 34
Branch analysis from position: 17
2 jumps found. (Code = 77) Position 1 = 19, Position 2 = 26
Branch analysis from position: 19
2 jumps found. (Code = 78) Position 1 = 20, Position 2 = 26
Branch analysis from position: 20
2 jumps found. (Code = 43) Position 1 = 23, Position 2 = 25
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 26
Branch analysis from position: 26
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 19
Branch analysis from position: 19
Branch analysis from position: 26
Branch analysis from position: 26
Branch analysis from position: 34
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 34
filename:       /in/IrNFd
function name:  (null)
number of ops:  36
compiled vars:  !0 = $values, !1 = $ordered_values, !2 = $value, !3 = $key, !4 = $ordered_value, !5 = $ordered_key
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
    3     1        ASSIGN_DIM                                               !0, 0
          2        OP_DATA                                                  5
    4     3        ASSIGN_DIM                                               !0, 1
          4        OP_DATA                                                  12
    5     5        ASSIGN_DIM                                               !0, 2
          6        OP_DATA                                                  19
    6     7        ASSIGN_DIM                                               !0, 3
          8        OP_DATA                                                  9
    7     9        ASSIGN_DIM                                               !0, 4
         10        OP_DATA                                                  5
    9    11        ASSIGN                                                   !1, !0
   10    12        INIT_FCALL                                               'rsort'
         13        SEND_REF                                                 !1
         14        DO_ICALL                                                 
   12    15      > FE_RESET_R                                       $14     !0, ->34
         16    > > FE_FETCH_R                                       ~15     $14, !2, ->34
         17    >   ASSIGN                                                   !3, ~15
   13    18      > FE_RESET_R                                       $17     !1, ->26
         19    > > FE_FETCH_R                                       ~18     $17, !4, ->26
         20    >   ASSIGN                                                   !5, ~18
   14    21        IS_IDENTICAL                                             !2, !4
         22      > JMPZ                                                     ~20, ->25
   15    23    >   ASSIGN                                                   !3, !5
   16    24      > JMP                                                      ->26
   13    25    > > JMP                                                      ->19
         26    >   FE_FREE                                                  $17
   19    27        CONCAT                                           ~22     !2, '-+Rank%3A+'
         28        CAST                                          4  ~23     !3
         29        ADD                                              ~24     ~23, 1
         30        CONCAT                                           ~25     ~22, ~24
         31        CONCAT                                           ~26     ~25, '%3Cbr%2F%3E'
         32        ECHO                                                     ~26
   12    33      > JMP                                                      ->16
         34    >   FE_FREE                                                  $14
   20    35      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
176.27 ms | 1400 KiB | 15 Q