3v4l.org

run code in 300+ PHP versions simultaneously
<?php define( 'SIZES', array_flip([ "116", "128", "140", "152", "164", "XXS", "XS", "S", "M", "L", "XL", "XXL", "XXXL", "XXXXL", "XXXXXL" ]) ); $array = [ ['id' => 613, 'maat' => 'maat XL', 'sort' => 0], ['id' => 614, 'maat' => 'maat XXL', 'sort' => 1], ['id' => 620, 'maat' => 'maat XL', 'sort' => 2], ['id' => 621, 'maat' => 'maat 152', 'sort' => 0], ['id' => 623, 'maat' => 'maat S', 'sort' => 1], ['id' => 643, 'maat' => 'maat XL', 'sort' => 1], ]; uasort( $array, fn($a, $b) => [SIZES[substr($a['maat'], 5)], $a['sort']] <=> [SIZES[substr($b['maat'], 5)], $b['sort']] ); var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/udmN5
function name:  (null)
number of ops:  17
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'define'
    4     1        SEND_VAL                                                 'SIZES'
    5     2        INIT_FCALL                                               'array_flip'
    6     3        SEND_VAL                                                 <array>
    5     4        DO_ICALL                                         $1      
    6     5        SEND_VAR                                                 $1
    3     6        DO_ICALL                                                 
   24     7        ASSIGN                                                   !0, <array>
   33     8        INIT_FCALL                                               'uasort'
   34     9        SEND_REF                                                 !0
   35    10        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
   39    11        SEND_VAL                                                 ~4
   33    12        DO_ICALL                                                 
   40    13        INIT_FCALL                                               'var_export'
         14        SEND_VAR                                                 !0
         15        DO_ICALL                                                 
         16      > 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/udmN5
function name:  {closure}
number of ops:  25
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   35     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   36     2        FETCH_CONSTANT                                   ~2      'SIZES'
          3        INIT_FCALL                                               'substr'
          4        FETCH_DIM_R                                      ~3      !0, 'maat'
          5        SEND_VAL                                                 ~3
          6        SEND_VAL                                                 5
          7        DO_ICALL                                         $4      
          8        FETCH_DIM_R                                      ~5      ~2, $4
          9        INIT_ARRAY                                       ~6      ~5
         10        FETCH_DIM_R                                      ~7      !0, 'sort'
         11        ADD_ARRAY_ELEMENT                                ~6      ~7
   38    12        FETCH_CONSTANT                                   ~8      'SIZES'
         13        INIT_FCALL                                               'substr'
         14        FETCH_DIM_R                                      ~9      !1, 'maat'
         15        SEND_VAL                                                 ~9
         16        SEND_VAL                                                 5
         17        DO_ICALL                                         $10     
         18        FETCH_DIM_R                                      ~11     ~8, $10
         19        INIT_ARRAY                                       ~12     ~11
         20        FETCH_DIM_R                                      ~13     !1, 'sort'
         21        ADD_ARRAY_ELEMENT                                ~12     ~13
         22        SPACESHIP                                        ~14     ~6, ~12
         23      > RETURN                                                   ~14
   39    24*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.25 ms | 1014 KiB | 18 Q