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}/', $sc, $matches1); preg_match_all('/[0-9]{5,10}:[0-9]{1,5}/', $sc, $matches2); $my_matches[1] = $matches1[0]; $my_matches[2] = $matches2[0]; $cub[1] = function($match) { return array( 'batch' => $match, 'type' => '1', ); }; $cub[2] = function($match) { return array( 'batch' => $match, 'type' => '2', ); }; $result = call_user_func_array('array_merge', array_map(function($a, $b) { return array_map($a, $b); }, $cub, $my_matches)); var_dump($result);
Output for git.master, git.master_jit, rfc.property-hooks
array(5) { [0]=> array(2) { ["batch"]=> string(7) "8491241" ["type"]=> string(1) "1" } [1]=> array(2) { ["batch"]=> string(7) "6254841" ["type"]=> string(1) "1" } [2]=> array(2) { ["batch"]=> string(6) "568241" ["type"]=> string(1) "1" } [3]=> array(2) { ["batch"]=> string(6) "414844" ["type"]=> string(1) "1" } [4]=> array(2) { ["batch"]=> string(10) "414844:412" ["type"]=> string(1) "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:
18.82 ms | 402 KiB | 8 Q