3v4l.org

run code in 300+ PHP versions simultaneously
<?php $re = '/(\((?:[^()]++|(?1))*\))(*SKIP)(*F)|,\h*/'; $strings = [ "Test A, Test B, Test C (data1, data1)", "Test A, Test B, Test C (data1, data1), Test D (data1, data1), Test E (data1, data1(data, data))", "Test A, Test B, Test C (data1, data1), Test D (data1, data1), Test E ((data1, data1))" ]; foreach($strings as $s) { print_r(preg_split($re, $s)); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 3, Position 2 = 12
Branch analysis from position: 3
2 jumps found. (Code = 78) Position 1 = 4, Position 2 = 12
Branch analysis from position: 4
1 jumps found. (Code = 42) Position 1 = 3
Branch analysis from position: 3
Branch analysis from position: 12
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 12
filename:       /in/uZNg5
function name:  (null)
number of ops:  14
compiled vars:  !0 = $re, !1 = $strings, !2 = $s
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   ASSIGN                                                   !0, '%2F%28%5C%28%28%3F%3A%5B%5E%28%29%5D%2B%2B%7C%28%3F1%29%29%2A%5C%29%29%28%2ASKIP%29%28%2AF%29%7C%2C%5Ch%2A%2F'
    4     1        ASSIGN                                                   !1, <array>
   10     2      > FE_RESET_R                                       $5      !1, ->12
          3    > > FE_FETCH_R                                               $5, !2, ->12
   11     4    >   INIT_FCALL                                               'print_r'
          5        INIT_FCALL                                               'preg_split'
          6        SEND_VAR                                                 !0
          7        SEND_VAR                                                 !2
          8        DO_ICALL                                         $6      
          9        SEND_VAR                                                 $6
         10        DO_ICALL                                                 
   10    11      > JMP                                                      ->3
         12    >   FE_FREE                                                  $5
   12    13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
244.92 ms | 1002 KiB | 15 Q