3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = [ 'Size: tiny', 'Size: small', 'Size: big', 'Colour: yellow', 'Colour: black', 'Colour: blue', 'Length: short', 'Length: long' ]; $result = []; foreach ($array as $v) { $result[strtok(':', $v)][] = $v; } var_export(array_values($result));
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/X4SJQ
function name:  (null)
number of ops:  20
compiled vars:  !0 = $array, !1 = $result, !2 = $v
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                       !0, <array>
   14     1        ASSIGN                                                       !1, <array>
   15     2      > FE_RESET_R                                           $5      !0, ->12
          3    > > FE_FETCH_R                                                   $5, !2, ->12
   16     4    >   INIT_FCALL                                                   'strtok'
          5        SEND_VAL                                                     '%3A'
          6        SEND_VAR                                                     !2
          7        DO_ICALL                                             $6      
          8        FETCH_DIM_W                                          $7      !1, $6
          9        ASSIGN_DIM                                                   $7
         10        OP_DATA                                                      !2
   15    11      > JMP                                                          ->3
         12    >   FE_FREE                                                      $5
   18    13        INIT_FCALL                                                   'var_export'
         14        INIT_FCALL                                                   'array_values'
         15        SEND_VAR                                                     !1
         16        DO_ICALL                                             $9      
         17        SEND_VAR                                                     $9
         18        DO_ICALL                                                     
         19      > RETURN                                                       1

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
169.39 ms | 1469 KiB | 16 Q