3v4l.org

run code in 300+ PHP versions simultaneously
<?php //$rawGroups = file('/pat/to/.htgroup'); $rawGroups = [ 'admins: amy bill', 'support: charlie david edward', 'guests: fernando ivonne', ]; $usersByGroup = []; foreach ($rawGroups as $rawGroup) { if (!preg_match('/^\s*(?P<group>[\S]+)\s*:\s*(?P<users>.+)\s*$/', $rawGroup, $matches)) { continue; } $usersByGroup[$matches['group']] = preg_split('/\s+/', $matches['users']); } print_r($usersByGroup);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 21
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 21
Branch analysis from position: 4
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 12
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 21
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 21
filename:       /in/heD2Y
function name:  (null)
number of ops:  26
compiled vars:  !0 = $rawGroups, !1 = $usersByGroup, !2 = $rawGroup, !3 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, <array>
    9     1        ASSIGN                                                   !1, <array>
   10     2      > FE_RESET_R                                       $6      !0, ->21
          3    > > FE_FETCH_R                                               $6, !2, ->21
   11     4    >   INIT_FCALL                                               'preg_match'
          5        SEND_VAL                                                 '%2F%5E%5Cs%2A%28%3FP%3Cgroup%3E%5B%5CS%5D%2B%29%5Cs%2A%3A%5Cs%2A%28%3FP%3Cusers%3E.%2B%29%5Cs%2A%24%2F'
          6        SEND_VAR                                                 !2
          7        SEND_REF                                                 !3
          8        DO_ICALL                                         $7      
          9        BOOL_NOT                                         ~8      $7
         10      > JMPZ                                                     ~8, ->12
   12    11    > > JMP                                                      ->3
   14    12    >   FETCH_DIM_R                                      ~9      !3, 'group'
         13        INIT_FCALL                                               'preg_split'
         14        SEND_VAL                                                 '%2F%5Cs%2B%2F'
         15        FETCH_DIM_R                                      ~11     !3, 'users'
         16        SEND_VAL                                                 ~11
         17        DO_ICALL                                         $12     
         18        ASSIGN_DIM                                               !1, ~9
         19        OP_DATA                                                  $12
   10    20      > JMP                                                      ->3
         21    >   FE_FREE                                                  $6
   16    22        INIT_FCALL                                               'print_r'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.82 ms | 1013 KiB | 16 Q