3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array(array(77, 87), array(23, 45)); $array2 = array("w3resource", "com"); function merge_arrays_by_index($x, $y) { $temp = array(); $temp[] = $x; if(is_scalar($y)) { $temp[] = $y; } else { foreach($y as $k => $v) { $temp[] = $v; } } return $temp; } $test = merge_arrays_by_index($array2,$array1); print_r($test); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [0] => w3resource [1] => com ) [1] => Array ( [0] => 77 [1] => 87 ) [2] => Array ( [0] => 23 [1] => 45 ) )

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:
45.88 ms | 401 KiB | 8 Q