3v4l.org

run code in 300+ PHP versions simultaneously
<?php $sc = 'hello 8491241 some text 6254841 some text 568241 414844:412'; preg_match_all('/([0-9]{5,10})(:[0-9]{1,5})?/', $sc, $matches, PREG_SET_ORDER); $all_matches = array_reduce($matches, function (array $all, array $match) { $all[] = ['batch' => $match[1], 'type' => '1']; if (isset($match[2])) { $all[] = ['batch' => $match[0], 'type' => '2']; } return $all; }, []); print_r($all_matches);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [batch] => 8491241 [type] => 1 ) [1] => Array ( [batch] => 6254841 [type] => 1 ) [2] => Array ( [batch] => 568241 [type] => 1 ) [3] => Array ( [batch] => 414844 [type] => 1 ) [4] => Array ( [batch] => 414844:412 [type] => 2 ) )

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:
80.95 ms | 402 KiB | 8 Q