3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'field_bathrooms' => 'Bathrooms', 'field_bedrooms' => 'Bedrooms', 'field_king_beds' => 'King Beds', 'field_kitchen' => 'Kitchen', 'field_queen_beds' => 'Queen Beds', 'field_sleeps_max' => 'Sleeps', 'field_sofa_beds' => 'Sofa Beds', 'field_sqft' => 'Square Footage', 'field_twin_beds' => 'Twin Beds', ]; $order = [ 'Bathrooms', 'Square Footage', 'King Beds', 'Sofa Beds', 'Sleeps', 'Twin Beds', 'Queen Beds', 'Kitchen', 'Bedrooms', ]; $order = array_flip($order); uasort( $array, fn($a, $b) => $order[$a] <=> $order[$b] ); var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/WdnVP
function name:  (null)
number of ops:  16
compiled vars:  !0 = $array, !1 = $order
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   15     1        ASSIGN                                                   !1, <array>
   27     2        INIT_FCALL                                               'array_flip'
          3        SEND_VAR                                                 !1
          4        DO_ICALL                                         $4      
          5        ASSIGN                                                   !1, $4
   28     6        INIT_FCALL                                               'uasort'
   29     7        SEND_REF                                                 !0
   30     8        DECLARE_LAMBDA_FUNCTION                          ~6      [0]
          9        BIND_LEXICAL                                             ~6, !1
   31    10        SEND_VAL                                                 ~6
   28    11        DO_ICALL                                                 
   32    12        INIT_FCALL                                               'var_export'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                                 
         15      > 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/WdnVP
function name:  {closure}
number of ops:  8
compiled vars:  !0 = $a, !1 = $b, !2 = $order
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   30     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        FETCH_DIM_R                                      ~3      !2, !0
          4        FETCH_DIM_R                                      ~4      !2, !1
          5        SPACESHIP                                        ~5      ~3, ~4
          6      > RETURN                                                   ~5
   31     7*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.11 ms | 1000 KiB | 16 Q