3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = '182507 { 6661(T) }, 182514 { 5551(T), 5553(T), 5552(T) }'; preg_match_all('/(\d+)\s*{\s*([^}]+)\s*}/', $string, $matches); $output = array(); foreach ($matches[1] as $key => $value) { $output[$key] = array_merge(array($value), preg_split('/\s*,\s*/', $matches[2][$key])); } print_r($output);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [0] => 182507 [1] => 6661(T) ) [1] => Array ( [0] => 182514 [1] => 5551(T) [2] => 5553(T) [3] => 5552(T) ) )

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