3v4l.org

run code in 300+ PHP versions simultaneously
<?php $front = ["front_first", "front_second"]; $inside = ["inside_first", "inside_second", "inside_third"]; $back = ["back_first", "back_second", "back_third", "back_fourth"]; var_export( array_merge( ...array_map( function(...$cols) { static $lastSet; foreach ($cols as $i => &$v) { $v ??= $lastSet[$i]; } $lastSet = $cols; return $cols; }, $back, $front, $inside ) ) );
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'back_first', 1 => 'front_first', 2 => 'inside_first', 3 => 'back_second', 4 => 'front_second', 5 => 'inside_second', 6 => 'back_third', 7 => 'front_second', 8 => 'inside_third', 9 => 'back_fourth', 10 => 'front_second', 11 => 'inside_third', )

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.52 ms | 406 KiB | 5 Q