3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = <<<EOD [a-1]****************** [b-2]********** [c-3]*** EOD; preg_match_all('/^\[([a-z]-\d)](.*?)$/m' , $text, $matches, PREG_SET_ORDER); $result = array(); foreach ($matches as $match) { $result[$match[1]] = $match[2]; } var_dump($result);
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 9, Position 2 = 15
Branch analysis from position: 9
2 jumps found. (Code = 78) Position 1 = 10, Position 2 = 15
Branch analysis from position: 10
1 jumps found. (Code = 42) Position 1 = 9
Branch analysis from position: 9
Branch analysis from position: 15
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 15
filename:       /in/3jJq9
function name:  (null)
number of ops:  20
compiled vars:  !0 = $text, !1 = $matches, !2 = $result, !3 = $match
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%5Ba-1%5D%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A%5Bb-2%5D%2A%2A%2A%2A%2A%2A%2A%2A%2A%2A%0A%5Bc-3%5D%2A%2A%2A'
    9     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%2F%5E%5C%5B%28%5Ba-z%5D-%5Cd%29%5D%28.%2A%3F%29%24%2Fm'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        SEND_VAL                                                 2
          6        DO_ICALL                                                 
   10     7        ASSIGN                                                   !2, <array>
   11     8      > FE_RESET_R                                       $7      !1, ->15
          9    > > FE_FETCH_R                                               $7, !3, ->15
   12    10    >   FETCH_DIM_R                                      ~8      !3, 1
         11        FETCH_DIM_R                                      ~10     !3, 2
         12        ASSIGN_DIM                                               !2, ~8
         13        OP_DATA                                                  ~10
   11    14      > JMP                                                      ->9
         15    >   FE_FREE                                                  $7
   15    16        INIT_FCALL                                               'var_dump'
         17        SEND_VAR                                                 !2
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.57 ms | 1395 KiB | 17 Q