3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'Data 1 table 1', '', 'Data 3 table 1', '', '', 'Data 6 table 1', '', 'Data 8 table 1', '', 'Data 10 table 1', ]; $filter = [ 'Data 1 table 2', 'Data 2 table 2', 'Data 3 table 2', 'Data 4 table 2', 'Data 5 table 2', ]; $array = array_map(function($v) use ($filter) { if (empty($v)) { $v = array_shift($filter); } return $v; }, $array); print_r($array);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Data 1 table 1 [1] => Data 1 table 2 [2] => Data 3 table 1 [3] => Data 1 table 2 [4] => Data 1 table 2 [5] => Data 6 table 1 [6] => Data 1 table 2 [7] => Data 8 table 1 [8] => Data 1 table 2 [9] => Data 10 table 1 )

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