3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ "GL001_M", "GL001_XS", "GL001_S", "GL001_L", "GL002_M", "GL002_XS", "GL002_S", "GL002_L" ]; foreach ($array as $v) { [$ids[], $sizes[]] = explode('_', $v, 2); } array_multisort( $ids, $sizes, SORT_DESC, $array ); var_export($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 16
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 16
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 16
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 16
filename:       /in/GHG0E
function name:  (null)
number of ops:  27
compiled vars:  !0 = $array, !1 = $v, !2 = $ids, !3 = $sizes
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   13     1      > FE_RESET_R                                       $5      !0, ->16
          2    > > FE_FETCH_R                                               $5, !1, ->16
   14     3    >   INIT_FCALL                                               'explode'
          4        SEND_VAL                                                 '_'
          5        SEND_VAR                                                 !1
          6        SEND_VAL                                                 2
          7        DO_ICALL                                         $6      
          8        FETCH_LIST_R                                     $7      $6, 0
          9        ASSIGN_DIM                                               !2
         10        OP_DATA                                                  $7
         11        FETCH_LIST_R                                     $9      $6, 1
         12        ASSIGN_DIM                                               !3
         13        OP_DATA                                                  $9
         14        FREE                                                     $6
   13    15      > JMP                                                      ->2
         16    >   FE_FREE                                                  $5
   16    17        INIT_FCALL                                               'array_multisort'
   17    18        SEND_REF                                                 !2
   18    19        SEND_REF                                                 !3
   19    20        SEND_VAL                                                 3
   20    21        SEND_REF                                                 !0
   16    22        DO_ICALL                                                 
   22    23        INIT_FCALL                                               'var_export'
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                                 
         26      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
136.19 ms | 1000 KiB | 16 Q