3v4l.org

run code in 300+ PHP versions simultaneously
<?php $base = array("orange", "banana", "apple", "raspberry"); $replacements = array(0 => "pineapple", 4 => "cherry"); $replacements2 = array(0 => "grape"); $basket = array_replace($base, $replacements, $replacements2); print_r($basket); $array1 = array("color" => "red", 2, 4); $array2 = array("a", "b", "color" => "green", "shape" => "trapezoid", 4); $result = array_merge($array1, $array2); print_r($result); print_r(array_replace($array1, $array2));
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => grape [1] => banana [2] => apple [3] => raspberry [4] => cherry ) Array ( [color] => green [0] => 2 [1] => 4 [2] => a [3] => b [shape] => trapezoid [4] => 4 ) Array ( [color] => green [0] => a [1] => b [shape] => trapezoid [2] => 4 )

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:
41.66 ms | 402 KiB | 8 Q