3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '[1,[01,11,12] ,4 ,5, [20,21,22]]'; $parts = preg_split('/,(?![^\[]*\])/', $string, -1, PREG_SPLIT_DELIM_CAPTURE); $output = array(); foreach ($parts as $part) { $part = trim($part, '[] '); $output[] = explode(',', $part); } print_r($output);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [0] => 1 ) [1] => Array ( [0] => 01 [1] => 11 [2] => 12 ) [2] => Array ( [0] => 4 ) [3] => Array ( [0] => 5 ) [4] => Array ( [0] => 20 [1] => 21 [2] => 22 ) )

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:
26.37 ms | 406 KiB | 5 Q