3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array1 = [ [536870914 => 34213897], [536870914 => 34213905], [536870915 => 34213921], [536870914 => 34213913], [536870915 => 34213929], [536870917 => 34213937], [536870925 => 34218049], ]; $array2 = [ 536870925, 536870914, 536870915, 536870917, ]; $array2 = array_flip($array2); usort($array1, function($a, $b) use ($array2) { return $array2[key($a)] <=> $array2[key($b)]; }); var_export($array1);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IvkY0
function name:  (null)
number of ops:  16
compiled vars:  !0 = $array1, !1 = $array2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                       !0, <array>
   12     1        ASSIGN                                                       !1, <array>
   19     2        INIT_FCALL                                                   'array_flip'
          3        SEND_VAR                                                     !1
          4        DO_ICALL                                             $4      
          5        ASSIGN                                                       !1, $4
   21     6        INIT_FCALL                                                   'usort'
          7        SEND_REF                                                     !0
          8        DECLARE_LAMBDA_FUNCTION                              ~6      [0]
          9        BIND_LEXICAL                                                 ~6, !1
   23    10        SEND_VAL                                                     ~6
   21    11        DO_ICALL                                                     
   25    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/IvkY0
function name:  {closure:/in/IvkY0:21}
number of ops:  14
compiled vars:  !0 = $a, !1 = $b, !2 = $array2
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        BIND_STATIC                                                  !2
   22     3        INIT_FCALL                                                   'key'
          4        SEND_VAR                                                     !0
          5        DO_ICALL                                             $3      
          6        FETCH_DIM_R                                          ~4      !2, $3
          7        INIT_FCALL                                                   'key'
          8        SEND_VAR                                                     !1
          9        DO_ICALL                                             $5      
         10        FETCH_DIM_R                                          ~6      !2, $5
         11        SPACESHIP                                            ~7      ~4, ~6
         12      > RETURN                                                       ~7
   23    13*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.74 ms | 2370 KiB | 17 Q