3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array1 = array('a','b','c','d','x','u','xx'); $array2 = array('e','f','g','h','s','d','t'); $array3 = array('i','j','k','l'); $array = [$array1, $array2, $array3]; $maxCount = max(array_map('count', $array)); $result = []; for ($i = 0; $i < $maxCount; ++$i) { foreach (array_column($array, $i) as $found) { $result[] = $found; } } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'a', 1 => 'e', 2 => 'i', 3 => 'b', 4 => 'f', 5 => 'j', 6 => 'c', 7 => 'g', 8 => 'k', 9 => 'd', 10 => 'h', 11 => 'l', 12 => 'x', 13 => 's', 14 => 'u', 15 => 'd', 16 => 'xx', 17 => 't', )

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:
26.82 ms | 406 KiB | 5 Q