3v4l.org

run code in 300+ PHP versions simultaneously
<?php $rangeArr = Array ( "0" => 12 , "1" => 17 , "2" => 5, "3" => 27, "4" => 5 ); $count = 0; $unique = $rangeArr; arsort($unique); $unique = array_count_values($unique); foreach ($unique as $key => $frequency) { foreach (range(1, $frequency) as $i) { $unique[$key] += $count++; } $unique[$key] /= $frequency; } foreach ($rangeArr as $key => $value) { $data[$key] = $rangeArr[$key] . ': '. $unique[$value]; } printr($rangeArr); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 11, Position 2 = 27
Branch analysis from position: 11
2 jumps found. (Code = 78) Position 1 = 12, Position 2 = 27
Branch analysis from position: 12
2 jumps found. (Code = 77) Position 1 = 18, Position 2 = 23
Branch analysis from position: 18
2 jumps found. (Code = 78) Position 1 = 19, Position 2 = 23
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 18
Branch analysis from position: 18
Branch analysis from position: 23
1 jumps found. (Code = 42) Position 1 = 11
Branch analysis from position: 11
Branch analysis from position: 23
Branch analysis from position: 27
2 jumps found. (Code = 77) Position 1 = 29, Position 2 = 38
Branch analysis from position: 29
2 jumps found. (Code = 78) Position 1 = 30, Position 2 = 38
Branch analysis from position: 30
1 jumps found. (Code = 42) Position 1 = 29
Branch analysis from position: 29
Branch analysis from position: 38
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 38
Branch analysis from position: 27
filename:       /in/I1ONe
function name:  (null)
number of ops:  43
compiled vars:  !0 = $rangeArr, !1 = $count, !2 = $unique, !3 = $frequency, !4 = $key, !5 = $i, !6 = $value, !7 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    5     1        ASSIGN                                                   !1, 0
    6     2        ASSIGN                                                   !2, !0
          3        INIT_FCALL                                               'arsort'
          4        SEND_REF                                                 !2
          5        DO_ICALL                                                 
    7     6        INIT_FCALL                                               'array_count_values'
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $12     
          9        ASSIGN                                                   !2, $12
    9    10      > FE_RESET_R                                       $14     !2, ->27
         11    > > FE_FETCH_R                                       ~15     $14, !3, ->27
         12    >   ASSIGN                                                   !4, ~15
   10    13        INIT_FCALL                                               'range'
         14        SEND_VAL                                                 1
         15        SEND_VAR                                                 !3
         16        DO_ICALL                                         $17     
         17      > FE_RESET_R                                       $18     $17, ->23
         18    > > FE_FETCH_R                                               $18, !5, ->23
   11    19    >   POST_INC                                         ~20     !1
         20        ASSIGN_DIM_OP                +=               1          !2, !4
         21        OP_DATA                                                  ~20
   10    22      > JMP                                                      ->18
         23    >   FE_FREE                                                  $18
   14    24        ASSIGN_DIM_OP                /=               4          !2, !4
         25        OP_DATA                                                  !3
    9    26      > JMP                                                      ->11
         27    >   FE_FREE                                                  $14
   17    28      > FE_RESET_R                                       $22     !0, ->38
         29    > > FE_FETCH_R                                       ~23     $22, !6, ->38
         30    >   ASSIGN                                                   !4, ~23
   18    31        FETCH_DIM_R                                      ~26     !0, !4
         32        CONCAT                                           ~27     ~26, '%3A+'
         33        FETCH_DIM_R                                      ~28     !2, !6
         34        CONCAT                                           ~29     ~27, ~28
         35        ASSIGN_DIM                                               !7, !4
         36        OP_DATA                                                  ~29
   17    37      > JMP                                                      ->29
         38    >   FE_FREE                                                  $22
   21    39        INIT_FCALL_BY_NAME                                       'printr'
         40        SEND_VAR_EX                                              !0
         41        DO_FCALL                                      0          
   22    42      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
186.02 ms | 1400 KiB | 19 Q