3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr1 = [ 0 => 'Data 1 Table 1', 1 => null, 2 => 'Data 2 Table 1', 3 => null, 4 => null, 5 => 'Data 3 Table 1', ]; $arr2 = [ 0 => 'Data 1 Table 2', 1 => 'Data 2 Table 2', 2 => 'Data 3 Table 2', ]; $result = array_replace($arr1,array_combine(array_keys(array_intersect($arr1, [null])), $arr2)); var_dump($result);
Output for git.master, git.master_jit, rfc.property-hooks
array(6) { [0]=> string(14) "Data 1 Table 1" [1]=> string(14) "Data 1 Table 2" [2]=> string(14) "Data 2 Table 1" [3]=> string(14) "Data 2 Table 2" [4]=> string(14) "Data 3 Table 2" [5]=> string(14) "Data 3 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:
125.94 ms | 406 KiB | 5 Q