3v4l.org

run code in 300+ PHP versions simultaneously
<?php $strs= ["Rosemary Hess (2018) (Germany) (all media)", "Jackie H Spriggs (catering)"]; foreach ($strs as $s){ print_r( preg_split('~\s*(?=\([^()]*\))~', $s, 2) ); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 2, Position 2 = 12
Branch analysis from position: 2
2 jumps found. (Code = 78) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
1 jumps found. (Code = 42) Position 1 = 2
Branch analysis from position: 2
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/DNJd0
function name:  (null)
number of ops:  14
compiled vars:  !0 = $strs, !1 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, <array>
    4     1      > FE_RESET_R                                       $3      !0, ->12
          2    > > FE_FETCH_R                                               $3, !1, ->12
    5     3    >   INIT_FCALL                                               'print_r'
          4        INIT_FCALL                                               'preg_split'
          5        SEND_VAL                                                 '%7E%5Cs%2A%28%3F%3D%5C%28%5B%5E%28%29%5D%2A%5C%29%29%7E'
          6        SEND_VAR                                                 !1
          7        SEND_VAL                                                 2
          8        DO_ICALL                                         $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                                 
    4    11      > JMP                                                      ->2
         12    >   FE_FREE                                                  $3
    6    13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
137.18 ms | 998 KiB | 15 Q