3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numericPriorities = array_flip([5, 4, 65]); $numericOutlier = count($numericPriorities); $wordPriorities = array_flip(['first', 'second', 'third']); $wordOutlier = count($wordPriorities); $arr = ['third' => 321, 4 => 1, 'zero' => 'last of words', 7 => 'last of nums', 65 => 6, 'first' => 63, 5 => 88, 'second' => 0]; uksort( $arr, function($a, $b) use ($numericPriorities, $numericOutlier, $wordPriorities, $wordOutlier) { return [!is_int($a), $numericPriorities[$a] ?? $numericOutlier, $wordPriorities[$a] ?? $wordOutlier] <=> [!is_int($b), $numericPriorities[$b] ?? $numericOutlier, $wordPriorities[$b] ?? $wordOutlier]; } ); var_export($arr);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/vXuJm
function name:  (null)
number of ops:  26
compiled vars:  !0 = $numericPriorities, !1 = $numericOutlier, !2 = $wordPriorities, !3 = $wordOutlier, !4 = $arr
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'array_flip'
          1        SEND_VAL                                                 <array>
          2        DO_ICALL                                         $5      
          3        ASSIGN                                                   !0, $5
    4     4        COUNT                                            ~7      !0
          5        ASSIGN                                                   !1, ~7
    5     6        INIT_FCALL                                               'array_flip'
          7        SEND_VAL                                                 <array>
          8        DO_ICALL                                         $9      
          9        ASSIGN                                                   !2, $9
    6    10        COUNT                                            ~11     !2
         11        ASSIGN                                                   !3, ~11
    8    12        ASSIGN                                                   !4, <array>
   10    13        INIT_FCALL                                               'uksort'
   11    14        SEND_REF                                                 !4
   12    15        DECLARE_LAMBDA_FUNCTION                          ~14     [0]
         16        BIND_LEXICAL                                             ~14, !0
         17        BIND_LEXICAL                                             ~14, !1
         18        BIND_LEXICAL                                             ~14, !2
         19        BIND_LEXICAL                                             ~14, !3
   16    20        SEND_VAL                                                 ~14
   10    21        DO_ICALL                                                 
   19    22        INIT_FCALL                                               'var_export'
         23        SEND_VAR                                                 !4
         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/vXuJm
function name:  {closure}
number of ops:  31
compiled vars:  !0 = $a, !1 = $b, !2 = $numericPriorities, !3 = $numericOutlier, !4 = $wordPriorities, !5 = $wordOutlier
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        BIND_STATIC                                              !2
          3        BIND_STATIC                                              !3
          4        BIND_STATIC                                              !4
          5        BIND_STATIC                                              !5
   13     6        TYPE_CHECK                                   16  ~6      !0
          7        BOOL_NOT                                         ~7      ~6
          8        INIT_ARRAY                                       ~8      ~7
          9        FETCH_DIM_IS                                     ~9      !2, !0
         10        COALESCE                                         ~10     ~9
         11        QM_ASSIGN                                        ~10     !3
         12        ADD_ARRAY_ELEMENT                                ~8      ~10
         13        FETCH_DIM_IS                                     ~11     !4, !0
         14        COALESCE                                         ~12     ~11
         15        QM_ASSIGN                                        ~12     !5
         16        ADD_ARRAY_ELEMENT                                ~8      ~12
   15    17        TYPE_CHECK                                   16  ~13     !1
         18        BOOL_NOT                                         ~14     ~13
         19        INIT_ARRAY                                       ~15     ~14
         20        FETCH_DIM_IS                                     ~16     !2, !1
         21        COALESCE                                         ~17     ~16
         22        QM_ASSIGN                                        ~17     !3
         23        ADD_ARRAY_ELEMENT                                ~15     ~17
         24        FETCH_DIM_IS                                     ~18     !4, !1
         25        COALESCE                                         ~19     ~18
         26        QM_ASSIGN                                        ~19     !5
         27        ADD_ARRAY_ELEMENT                                ~15     ~19
         28        SPACESHIP                                        ~20     ~8, ~15
         29      > RETURN                                                   ~20
   16    30*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.71 ms | 1007 KiB | 16 Q