3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
152.76 ms | 1897 KiB | 15 Q