3v4l.org

run code in 300+ PHP versions simultaneously
<?php $right = [ [ 'FirstName' => 'Pim', 'Address' => 'Finland', 'LastName' => 'Svensson', 'ID' => 3 ], [ 'FirstName' => 'Emil', 'Address' => 'Sweden', 'LastName' => 'Malm', 'ID' => 5 ] ]; $left = array_flip(['ID', 'FirstName', 'LastName', 'Address']); array_multisort( array_map( fn($k) => $left[$k], array_keys($right[0] ?? []) ), ...$right ); var_export($right);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HJBOQ
function name:  (null)
number of ops:  26
compiled vars:  !0 = $right, !1 = $left
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   17     1        INIT_FCALL                                               'array_flip'
          2        SEND_VAL                                                 <array>
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
   19     5        INIT_FCALL                                               'array_multisort'
   20     6        INIT_FCALL                                               'array_map'
   21     7        DECLARE_LAMBDA_FUNCTION                          ~5      [0]
          8        BIND_LEXICAL                                             ~5, !1
          9        SEND_VAL                                                 ~5
   22    10        INIT_FCALL                                               'array_keys'
         11        FETCH_DIM_IS                                     ~6      !0, 0
         12        COALESCE                                         ~7      ~6
         13        QM_ASSIGN                                        ~7      <array>
         14        SEND_VAL                                                 ~7
         15        DO_ICALL                                         $8      
         16        SEND_VAR                                                 $8
   20    17        DO_ICALL                                         $9      
   22    18        SEND_VAL                                                 $9
   24    19        SEND_UNPACK                                              !0
         20        CHECK_UNDEF_ARGS                                         
   19    21        DO_ICALL                                                 
   26    22        INIT_FCALL                                               'var_export'
         23        SEND_VAR                                                 !0
         24        DO_ICALL                                                 
         25      > 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/HJBOQ
function name:  {closure}
number of ops:  5
compiled vars:  !0 = $k, !1 = $left
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
          2        FETCH_DIM_R                                      ~2      !1, !0
          3      > RETURN                                                   ~2
          4*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
144.25 ms | 1010 KiB | 18 Q