3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'a' => '1GB - 4GB', 'b' => '1TB - 2TB', 'c' => '3TB - 5TB', 'd' => '5GB - 16GB', 'e' => '6TB+', 'f' => '17GB - 32GB', 'g' => '33GB - 63GB', 'h' => '64GB - 120GB', 'i' => '121GB - 200GB', 'j' => '201GB - 300GB', 'k' => '301GB - 500GB', 'l' => '501GB - 1TB', ]; $nums = []; $units = []; foreach ($array as $v) { [$nums[], $units[]] = sscanf($v, '%d%[A-Z]'); } array_multisort($units, $nums, $array); var_export($array);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 4, Position 2 = 17
Branch analysis from position: 4
2 jumps found. (Code = 78) Position 1 = 5, Position 2 = 17
Branch analysis from position: 5
1 jumps found. (Code = 42) Position 1 = 4
Branch analysis from position: 4
Branch analysis from position: 17
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 17
filename:       /in/slcLT
function name:  (null)
number of ops:  27
compiled vars:  !0 = $array, !1 = $nums, !2 = $units, !3 = $v
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
   18     1        ASSIGN                                                   !1, <array>
   19     2        ASSIGN                                                   !2, <array>
   20     3      > FE_RESET_R                                       $7      !0, ->17
          4    > > FE_FETCH_R                                               $7, !3, ->17
   21     5    >   INIT_FCALL                                               'sscanf'
          6        SEND_VAR                                                 !3
          7        SEND_VAL                                                 '%25d%25%5BA-Z%5D'
          8        DO_ICALL                                         $8      
          9        FETCH_LIST_R                                     $9      $8, 0
         10        ASSIGN_DIM                                               !1
         11        OP_DATA                                                  $9
         12        FETCH_LIST_R                                     $11     $8, 1
         13        ASSIGN_DIM                                               !2
         14        OP_DATA                                                  $11
         15        FREE                                                     $8
   20    16      > JMP                                                      ->4
         17    >   FE_FREE                                                  $7
   23    18        INIT_FCALL                                               'array_multisort'
         19        SEND_REF                                                 !2
         20        SEND_REF                                                 !1
         21        SEND_REF                                                 !0
         22        DO_ICALL                                                 
   24    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:
142.72 ms | 1004 KiB | 16 Q