3v4l.org

run code in 300+ PHP versions simultaneously
<?php $indexes = [ 26 => ["namespace" => "X\\Y\\Zed"], 9 => ["namespace" => "A\\B\\See"], 3 => ["namespace" => "A\\B\\Bee"], 38 => ["namespace" => "A\\B\\C\\Dee"], 51 => ["namespace" => "X\\Wye"], 16 => ["namespace" => "A\\Sea"], 12 => ["namespace" => "A\\Bees"], 31 => ["namespace" => "M"], ]; uasort( $indexes, function($a, $b) { $aParts = explode('\\', $a['namespace']); $bParts = explode('\\', $b['namespace']); $aCount = count($aParts); $bCount = count($bParts); return count($bParts) <=> count($aParts) ?: (array_pad($aParts, $bCount, '~') <=> array_pad($bParts, $aCount, '~')); } ); var_export($indexes);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QvruO
function name:  (null)
number of ops:  10
compiled vars:  !0 = $indexes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   14     1        INIT_FCALL                                               'uasort'
   15     2        SEND_REF                                                 !0
   16     3        DECLARE_LAMBDA_FUNCTION                          ~2      [0]
   22     4        SEND_VAL                                                 ~2
   14     5        DO_ICALL                                                 
   24     6        INIT_FCALL                                               'var_export'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                                 
          9      > 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/QvruO
function name:  {closure}
number of ops:  36
compiled vars:  !0 = $a, !1 = $b, !2 = $aParts, !3 = $bParts, !4 = $aCount, !5 = $bCount
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   17     2        INIT_FCALL                                               'explode'
          3        SEND_VAL                                                 '%5C'
          4        FETCH_DIM_R                                      ~6      !0, 'namespace'
          5        SEND_VAL                                                 ~6
          6        DO_ICALL                                         $7      
          7        ASSIGN                                                   !2, $7
   18     8        INIT_FCALL                                               'explode'
          9        SEND_VAL                                                 '%5C'
         10        FETCH_DIM_R                                      ~9      !1, 'namespace'
         11        SEND_VAL                                                 ~9
         12        DO_ICALL                                         $10     
         13        ASSIGN                                                   !3, $10
   19    14        COUNT                                            ~12     !2
         15        ASSIGN                                                   !4, ~12
   20    16        COUNT                                            ~14     !3
         17        ASSIGN                                                   !5, ~14
   21    18        COUNT                                            ~16     !3
         19        COUNT                                            ~17     !2
         20        SPACESHIP                                        ~18     ~16, ~17
         21        JMP_SET                                          ~19     ~18, ->34
         22        INIT_FCALL                                               'array_pad'
         23        SEND_VAR                                                 !2
         24        SEND_VAR                                                 !5
         25        SEND_VAL                                                 '%7E'
         26        DO_ICALL                                         $20     
         27        INIT_FCALL                                               'array_pad'
         28        SEND_VAR                                                 !3
         29        SEND_VAR                                                 !4
         30        SEND_VAL                                                 '%7E'
         31        DO_ICALL                                         $21     
         32        SPACESHIP                                        ~22     $20, $21
         33        QM_ASSIGN                                        ~19     ~22
         34      > RETURN                                                   ~19
   22    35*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.26 ms | 1078 KiB | 17 Q