3v4l.org

run code in 500+ PHP versions simultaneously
<?php $copy = $arr = [7, 9, 5, 10]; rsort($arr); $flipped = array_flip($arr); foreach($copy as $v) { $result[] = ++$flipped[$v]; } var_export($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 16
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 16
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/LphJk
function name:  (null)
number of ops:  21
compiled vars:  !0 = $copy, !1 = $arr, !2 = $flipped, !3 = $v, !4 = $result
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                               ~5      !1, <array>
          1        ASSIGN                                                       !0, ~5
    3     2        INIT_FCALL                                                   'rsort'
          3        SEND_REF                                                     !1
          4        DO_ICALL                                                     
    4     5        INIT_FCALL                                                   'array_flip'
          6        SEND_VAR                                                     !1
          7        DO_ICALL                                             $8      
          8        ASSIGN                                                       !2, $8
    5     9      > FE_RESET_R                                           $10     !0, ->16
         10    > > FE_FETCH_R                                                   $10, !3, ->16
    6    11    >   FETCH_DIM_RW                                         $12     !2, !3
         12        PRE_INC                                              ~13     $12
         13        ASSIGN_DIM                                                   !4
         14        OP_DATA                                                      ~13
    5    15      > JMP                                                          ->10
         16    >   FE_FREE                                                      $10
    8    17        INIT_FCALL                                                   'var_export'
         18        SEND_VAR                                                     !4
         19        DO_ICALL                                                     
         20      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
222.52 ms | 2053 KiB | 16 Q