3v4l.org

run code in 300+ PHP versions simultaneously
<?php $alternatives = array( 'foo' => 0, 'foo1' => 0, 'foo3' => 0, ); asort($alternatives, SORT_STRING); print_r($alternatives); $keys = array_keys($alternatives); print_r($keys); sort($keys); print_r($keys); sort($keys, SORT_STRING); print_r($keys); sort($keys, SORT_NAT); print_r($keys);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mjj8q
function name:  (null)
number of ops:  37
compiled vars:  !0 = $alternatives, !1 = $keys
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    8     1        INIT_FCALL                                               'asort'
          2        SEND_REF                                                 !0
          3        SEND_VAL                                                 2
          4        DO_ICALL                                                 
   10     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
   12     8        INIT_FCALL                                               'array_keys'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $5      
         11        ASSIGN                                                   !1, $5
   13    12        INIT_FCALL                                               'print_r'
         13        SEND_VAR                                                 !1
         14        DO_ICALL                                                 
   15    15        INIT_FCALL                                               'sort'
         16        SEND_REF                                                 !1
         17        DO_ICALL                                                 
   16    18        INIT_FCALL                                               'print_r'
         19        SEND_VAR                                                 !1
         20        DO_ICALL                                                 
   18    21        INIT_FCALL                                               'sort'
         22        SEND_REF                                                 !1
         23        SEND_VAL                                                 2
         24        DO_ICALL                                                 
   19    25        INIT_FCALL                                               'print_r'
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                                 
   21    28        INIT_FCALL                                               'sort'
         29        SEND_REF                                                 !1
         30        FETCH_CONSTANT                                   ~12     'SORT_NAT'
         31        SEND_VAL                                                 ~12
         32        DO_ICALL                                                 
   22    33        INIT_FCALL                                               'print_r'
         34        SEND_VAR                                                 !1
         35        DO_ICALL                                                 
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
167.7 ms | 1396 KiB | 21 Q