3v4l.org

run code in 500+ PHP versions simultaneously
<?php $arr = [ 'Alemanha' => 1, 'China' => 5, 'EUA' => 13, 'Itália' => 2, 'África do Sul' => 1 ]; $collator = new Collator('pt_BR'); $keys = array_keys($arr); $collator->sort($keys); var_export( array_replace( array_flip($keys), $arr ) );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/16etR
function name:  (null)
number of ops:  23
compiled vars:  !0 = $arr, !1 = $collator, !2 = $keys
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   11     1        NEW                                                  $4      'Collator'
          2        SEND_VAL_EX                                                  'pt_BR'
          3        DO_FCALL                                          0          
          4        ASSIGN                                                       !1, $4
   12     5        INIT_FCALL                                                   'array_keys'
          6        SEND_VAR                                                     !0
          7        DO_ICALL                                             $7      
          8        ASSIGN                                                       !2, $7
   13     9        INIT_METHOD_CALL                                             !1, 'sort'
         10        SEND_VAR_EX                                                  !2
         11        DO_FCALL                                          0          
   14    12        INIT_FCALL                                                   'var_export'
   15    13        INIT_FCALL                                                   'array_replace'
   16    14        INIT_FCALL                                                   'array_flip'
         15        SEND_VAR                                                     !2
         16        DO_ICALL                                             $10     
         17        SEND_VAR                                                     $10
   17    18        SEND_VAR                                                     !0
   15    19        DO_ICALL                                             $11     
   17    20        SEND_VAR                                                     $11
   14    21        DO_ICALL                                                     
   19    22      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
171.68 ms | 1899 KiB | 17 Q