3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a=array('a0','a1','a2','a3','a4','a5'); $b=array('b0','b1','b2','b3','b4','b5'); $flip = TRUE; $merged = array_map(function($v1, $v2)use(&$flip){ if($flip = !$flip ? TRUE : FALSE) return [$v2[0], $v1[0], $v2[1], $v1[1]]; return [$v1[0], $v2[0], $v1[1], $v2[1]]; }, array_chunk($a, 2), array_chunk($b, 2)); print_r($merged);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [0] => a0 [1] => b0 [2] => a1 [3] => b1 ) [1] => Array ( [0] => b2 [1] => a2 [2] => b3 [3] => a3 ) [2] => Array ( [0] => a4 [1] => b4 [2] => a5 [3] => b5 ) )

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