3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '(Mary Poppens) Umbrella (Color Yellow)'; preg_match_all('#\((.*?)\)|[^()]+#', $string, $match, PREG_SET_ORDER); foreach($match as $m){ if(isset($m[1])){ $array[] = explode(' ', $m[1]); }else{ $array[] = trim($m[0]); } } print_r($array); ?>
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 8, Position 2 = 26
Branch analysis from position: 8
2 jumps found. (Code = 78) Position 1 = 9, Position 2 = 26
Branch analysis from position: 9
2 jumps found. (Code = 43) Position 1 = 11, Position 2 = 19
Branch analysis from position: 11
1 jumps found. (Code = 42) Position 1 = 25
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 8
Branch analysis from position: 8
Branch analysis from position: 26
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 26
filename:       /in/7TCN0
function name:  (null)
number of ops:  31
compiled vars:  !0 = $string, !1 = $match, !2 = $m, !3 = $array
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%28Mary+Poppens%29+Umbrella+%28Color+Yellow%29'
    4     1        INIT_FCALL                                               'preg_match_all'
          2        SEND_VAL                                                 '%23%5C%28%28.%2A%3F%29%5C%29%7C%5B%5E%28%29%5D%2B%23'
          3        SEND_VAR                                                 !0
          4        SEND_REF                                                 !1
          5        SEND_VAL                                                 2
          6        DO_ICALL                                                 
    6     7      > FE_RESET_R                                       $6      !1, ->26
          8    > > FE_FETCH_R                                               $6, !2, ->26
    7     9    >   ISSET_ISEMPTY_DIM_OBJ                         0          !2, 1
         10      > JMPZ                                                     ~7, ->19
    8    11    >   INIT_FCALL                                               'explode'
         12        SEND_VAL                                                 '+'
         13        FETCH_DIM_R                                      ~9      !2, 1
         14        SEND_VAL                                                 ~9
         15        DO_ICALL                                         $10     
         16        ASSIGN_DIM                                               !3
         17        OP_DATA                                                  $10
         18      > JMP                                                      ->25
   10    19    >   INIT_FCALL                                               'trim'
         20        FETCH_DIM_R                                      ~12     !2, 0
         21        SEND_VAL                                                 ~12
         22        DO_ICALL                                         $13     
         23        ASSIGN_DIM                                               !3
         24        OP_DATA                                                  $13
    6    25    > > JMP                                                      ->8
         26    >   FE_FREE                                                  $6
   14    27        INIT_FCALL                                               'print_r'
         28        SEND_VAR                                                 !3
         29        DO_ICALL                                                 
   15    30      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.16 ms | 1396 KiB | 21 Q