3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array(2,10,4,5,2,1); $array2 = array('A','B','C','D','E','F'); $array3 = array_combine($array2, $array1); arsort($array3); $skip = 0; $i = 0; $temp = null; foreach($array3 as $k => $v) { if($temp !== $v) {$i++; $i += $skip; $skip = 0;}else {$skip++;} $temp = $v; echo $k, ' Rank: ', $i, "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 14, Position 2 = 29
Branch analysis from position: 14
2 jumps found. (Code = 78) Position 1 = 15, Position 2 = 29
Branch analysis from position: 15
2 jumps found. (Code = 43) Position 1 = 18, Position 2 = 22
Branch analysis from position: 18
1 jumps found. (Code = 42) Position 1 = 23
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 22
1 jumps found. (Code = 42) Position 1 = 14
Branch analysis from position: 14
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 29
filename:       /in/8IW73
function name:  (null)
number of ops:  31
compiled vars:  !0 = $array1, !1 = $array2, !2 = $array3, !3 = $skip, !4 = $i, !5 = $temp, !6 = $v, !7 = $k
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1        ASSIGN                                                   !1, <array>
    5     2        INIT_FCALL                                               'array_combine'
          3        SEND_VAR                                                 !1
          4        SEND_VAR                                                 !0
          5        DO_ICALL                                         $10     
          6        ASSIGN                                                   !2, $10
          7        INIT_FCALL                                               'arsort'
          8        SEND_REF                                                 !2
          9        DO_ICALL                                                 
    6    10        ASSIGN                                                   !3, 0
         11        ASSIGN                                                   !4, 0
         12        ASSIGN                                                   !5, null
    7    13      > FE_RESET_R                                       $16     !2, ->29
         14    > > FE_FETCH_R                                       ~17     $16, !6, ->29
         15    >   ASSIGN                                                   !7, ~17
    8    16        IS_NOT_IDENTICAL                                         !5, !6
         17      > JMPZ                                                     ~19, ->22
         18    >   PRE_INC                                                  !4
         19        ASSIGN_OP                                     1          !4, !3
         20        ASSIGN                                                   !3, 0
         21      > JMP                                                      ->23
         22    >   PRE_INC                                                  !3
    9    23    >   ASSIGN                                                   !5, !6
   10    24        ECHO                                                     !7
         25        ECHO                                                     '+Rank%3A+'
         26        ECHO                                                     !4
         27        ECHO                                                     '%0A'
    7    28      > JMP                                                      ->14
         29    >   FE_FREE                                                  $16
   12    30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
171.67 ms | 1396 KiB | 17 Q