3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ '=k_0' => ['test1'], 'aA_2' => ['test2'], 'sqA_1' => ['test3'], '=kj_0' => ['test4'], 'awA_2' => ['test5'], '= D_1' => ['test6'], 'sq A_1' => ['test7'], 'sqA_2' => ['test8'], ]; $trans = ['AjawbpfmnrhHxXsSqkgtTdD =', 'abcdefghijklmnopqrstuvwxy']; uksort( $array, function ($a, $b) use ($trans) { return strtr($a, ...$trans) <=> strtr($b, ...$trans); } ); var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VZISj
function name:  (null)
number of ops:  12
compiled vars:  !0 = $array, !1 = $trans
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   14     1        ASSIGN                                                   !1, <array>
   16     2        INIT_FCALL                                               'uksort'
   17     3        SEND_REF                                                 !0
   18     4        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
          5        BIND_LEXICAL                                             ~4, !1
   20     6        SEND_VAL                                                 ~4
   16     7        DO_ICALL                                                 
   23     8        INIT_FCALL                                               'var_export'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                                 
         11      > RETURN                                                   1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/VZISj
function name:  {closure}
number of ops:  16
compiled vars:  !0 = $a, !1 = $b, !2 = $trans
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
   19     3        INIT_FCALL                                               'strtr'
          4        SEND_VAR                                                 !0
          5        SEND_UNPACK                                              !2
          6        CHECK_UNDEF_ARGS                                         
          7        DO_ICALL                                         $3      
          8        INIT_FCALL                                               'strtr'
          9        SEND_VAR                                                 !1
         10        SEND_UNPACK                                              !2
         11        CHECK_UNDEF_ARGS                                         
         12        DO_ICALL                                         $4      
         13        SPACESHIP                                        ~5      $3, $4
         14      > RETURN                                                   ~5
   20    15*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
131.79 ms | 1429 KiB | 16 Q