3v4l.org

run code in 300+ PHP versions simultaneously
<?php $days = "Mon[3,9,11,24,25] Tue[1,2,3,9,11,15,16] Wed[5,9] Thu[5] Fri[5,11,24] Sat[5,11,30] Sun[4,10,28,29]"; $individualDays = explode(' ', $days); $result = []; foreach ($individualDays as $individualDay) { $dates = preg_match_all('/\d+/', $individualDay, $matches); $result[substr($individualDay, 0, 3)] = $matches[0]; } var_dump($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 24
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 24
Branch analysis from position: 9
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/coh9X
function name:  (null)
number of ops:  29
compiled vars:  !0 = $days, !1 = $individualDays, !2 = $result, !3 = $individualDay, !4 = $dates, !5 = $matches
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, 'Mon%5B3%2C9%2C11%2C24%2C25%5D+Tue%5B1%2C2%2C3%2C9%2C11%2C15%2C16%5D+Wed%5B5%2C9%5D+Thu%5B5%5D+Fri%5B5%2C11%2C24%5D+Sat%5B5%2C11%2C30%5D+Sun%5B4%2C10%2C28%2C29%5D'
    4     1        INIT_FCALL                                               'explode'
          2        SEND_VAL                                                 '+'
          3        SEND_VAR                                                 !0
          4        DO_ICALL                                         $7      
          5        ASSIGN                                                   !1, $7
    5     6        ASSIGN                                                   !2, <array>
    6     7      > FE_RESET_R                                       $10     !1, ->24
          8    > > FE_FETCH_R                                               $10, !3, ->24
    7     9    >   INIT_FCALL                                               'preg_match_all'
         10        SEND_VAL                                                 '%2F%5Cd%2B%2F'
         11        SEND_VAR                                                 !3
         12        SEND_REF                                                 !5
         13        DO_ICALL                                         $11     
         14        ASSIGN                                                   !4, $11
    8    15        INIT_FCALL                                               'substr'
         16        SEND_VAR                                                 !3
         17        SEND_VAL                                                 0
         18        SEND_VAL                                                 3
         19        DO_ICALL                                         $13     
         20        FETCH_DIM_R                                      ~15     !5, 0
         21        ASSIGN_DIM                                               !2, $13
         22        OP_DATA                                                  ~15
    6    23      > JMP                                                      ->8
         24    >   FE_FREE                                                  $10
   10    25        INIT_FCALL                                               'var_dump'
         26        SEND_VAR                                                 !2
         27        DO_ICALL                                                 
         28      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
140.86 ms | 1006 KiB | 17 Q