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; echo "First array"; var_dump($temp); if(is_scalar($y)) { $temp[] = $y; } else { foreach($y as $k => $v) { $temp[] = $v; echo $v; } } return $temp; } echo '<pre>'; print_r(array_map('merge_arrays_by_index',$array2, $array1)); ?>
Output for git.master, git.master_jit, rfc.property-hooks
<pre>First arrayarray(1) { [0]=> string(10) "w3resource" } 7787First arrayarray(1) { [0]=> string(3) "com" } 2345Array ( [0] => Array ( [0] => w3resource [1] => 77 [2] => 87 ) [1] => Array ( [0] => com [1] => 23 [2] => 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:
74.85 ms | 401 KiB | 8 Q