3v4l.org

run code in 300+ PHP versions simultaneously
<?php $assoc = [ 70 => 1, 82 => 5, 61 => 3, 55 => 1, 34 => 2, 53 => 2, 21 => 4, 13 => 5, ]; $arsort = $assoc; arsort($arsort); $keys = array_keys($assoc); array_multisort($assoc, SORT_DESC, range(1, count($assoc)), $keys); $assoc = array_combine($keys, $assoc); print_r(array($assoc, $arsort));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/fPkT2
function name:  (null)
number of ops:  31
compiled vars:  !0 = $assoc, !1 = $arsort, !2 = $keys
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   13     1        ASSIGN                                                   !1, !0
   14     2        INIT_FCALL                                               'arsort'
          3        SEND_REF                                                 !1
          4        DO_ICALL                                                 
   15     5        INIT_FCALL                                               'array_keys'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                         $6      
          8        ASSIGN                                                   !2, $6
   16     9        INIT_FCALL                                               'array_multisort'
         10        SEND_REF                                                 !0
         11        SEND_VAL                                                 3
         12        INIT_FCALL                                               'range'
         13        SEND_VAL                                                 1
         14        COUNT                                            ~8      !0
         15        SEND_VAL                                                 ~8
         16        DO_ICALL                                         $9      
         17        SEND_VAL                                                 $9
         18        SEND_REF                                                 !2
         19        DO_ICALL                                                 
   17    20        INIT_FCALL                                               'array_combine'
         21        SEND_VAR                                                 !2
         22        SEND_VAR                                                 !0
         23        DO_ICALL                                         $11     
         24        ASSIGN                                                   !0, $11
   19    25        INIT_FCALL                                               'print_r'
         26        INIT_ARRAY                                       ~13     !0
         27        ADD_ARRAY_ELEMENT                                ~13     !1
         28        SEND_VAL                                                 ~13
         29        DO_ICALL                                                 
         30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
172 ms | 1395 KiB | 25 Q