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)); }
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Test A [1] => Test B [2] => Test C (data1, data1) ) Array ( [0] => Test A [1] => Test B [2] => Test C (data1, data1) [3] => Test D (data1, data1) [4] => Test E (data1, data1(data, data)) ) Array ( [0] => Test A [1] => Test B [2] => Test C (data1, data1) [3] => Test D (data1, data1) [4] => Test E ((data1, data1)) )

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
36.7 ms | 406 KiB | 5 Q