3v4l.org

run code in 300+ PHP versions simultaneously
<?php define('SIZES', array_flip(['XXS', 'XS', 'S', 'M', 'L', 'XL', 'XXL'])); $array = ["GL001_XXL", "GL001_L", "GL001_XXS", "GL001_S"]; array_multisort( array_map(fn($v) => SIZES[substr($v, 6)], $array), $array ); var_export($array);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6HH7j
function name:  (null)
number of ops:  21
compiled vars:  !0 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'define'
          1        SEND_VAL                                                 'SIZES'
          2        INIT_FCALL                                               'array_flip'
          3        SEND_VAL                                                 <array>
          4        DO_ICALL                                         $1      
          5        SEND_VAR                                                 $1
          6        DO_ICALL                                                 
    5     7        ASSIGN                                                   !0, <array>
    7     8        INIT_FCALL                                               'array_multisort'
    8     9        INIT_FCALL                                               'array_map'
         10        DECLARE_LAMBDA_FUNCTION                          ~4      [0]
         11        SEND_VAL                                                 ~4
         12        SEND_VAR                                                 !0
         13        DO_ICALL                                         $5      
         14        SEND_VAL                                                 $5
    9    15        SEND_REF                                                 !0
    7    16        DO_ICALL                                                 
   11    17        INIT_FCALL                                               'var_export'
         18        SEND_VAR                                                 !0
         19        DO_ICALL                                                 
         20      > 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/6HH7j
function name:  {closure}
number of ops:  9
compiled vars:  !0 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        FETCH_CONSTANT                                   ~1      'SIZES'
          2        INIT_FCALL                                               'substr'
          3        SEND_VAR                                                 !0
          4        SEND_VAL                                                 6
          5        DO_ICALL                                         $2      
          6        FETCH_DIM_R                                      ~3      ~1, $2
          7      > RETURN                                                   ~3
          8*     > RETURN                                                   null

End of Dynamic Function 0

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
138.19 ms | 1004 KiB | 19 Q