3v4l.org

run code in 300+ PHP versions simultaneously
<?php $def = array( 1 => 'on', 2 => 'on', 3 => 'on' ); $fill = array( 2 => 'off' ); $res = array_merge($fill, $def); $res2 = array_merge($def, $fill); print_r($res); print_r($res2); function array_merge_custom($first, $second) { $result = array(); foreach($first as $key => $value) { $result[$key] = $value; } foreach($second as $key => $value) { $result[$key] = $value; } return $result; } $res3 = array_merge_custom($def, $fill);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => off [1] => on [2] => on [3] => on ) Array ( [0] => on [1] => on [2] => on [3] => off )

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:
99.82 ms | 401 KiB | 8 Q