3v4l.org

run code in 500+ PHP versions simultaneously
<?php $name = array( "ROWID" => [ 0 => 0, 1 => 1, 2 => 2, ], "First Name" => [ 0 => "BILLY", 1 => "SALLY", 2 => "TYLER", ], "Last Name" => [ 0 => "RAY", 1 => "SUE", 2 => "TERRIER" ], "Middle Name" => [ 0 => "B.", 1 => "S.", 2 => "T.", ], ); $ranking = array( 'ROWID', 'First Name', 'Middle Name', 'Last Name' ); var_dump( $name ); uksort( $name, function ( $a, $b ) use ( $ranking ) { return array_search ( $a, $ranking ) < array_search ( $b, $ranking ) ? -1 : 1; } ); echo "<hr>"; var_dump( $name );
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XmRlU
function name:  (null)
number of ops:  16
compiled vars:  !0 = $name, !1 = $ranking
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   25     1        ASSIGN                                                       !1, <array>
   32     2        INIT_FCALL                                                   'var_dump'
          3        SEND_VAR                                                     !0
          4        DO_ICALL                                                     
   33     5        INIT_FCALL                                                   'uksort'
          6        SEND_REF                                                     !0
          7        DECLARE_LAMBDA_FUNCTION                              ~5      [0]
          8        BIND_LEXICAL                                                 ~5, !1
   35     9        SEND_VAL                                                     ~5
   33    10        DO_ICALL                                                     
   36    11        ECHO                                                         '%3Chr%3E'
   37    12        INIT_FCALL                                                   'var_dump'
         13        SEND_VAR                                                     !0
         14        DO_ICALL                                                     
         15      > RETURN                                                       1


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 13, Position 2 = 15
Branch analysis from position: 13
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/XmRlU
function name:  {closure:/in/XmRlU:33}
number of ops:  18
compiled vars:  !0 = $a, !1 = $b, !2 = $ranking
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   33     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        BIND_STATIC                                                  !2
   34     3        INIT_FCALL                                                   'array_search'
          4        SEND_VAR                                                     !0
          5        SEND_VAR                                                     !2
          6        DO_ICALL                                             $3      
          7        INIT_FCALL                                                   'array_search'
          8        SEND_VAR                                                     !1
          9        SEND_VAR                                                     !2
         10        DO_ICALL                                             $4      
         11        IS_SMALLER                                                   $3, $4
         12      > JMPZ                                                         ~5, ->15
         13    >   QM_ASSIGN                                            ~6      -1
         14      > JMP                                                          ->16
         15    >   QM_ASSIGN                                            ~6      1
         16    > > RETURN                                                       ~6
   35    17*     > RETURN                                                       null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.04 ms | 2313 KiB | 16 Q