3v4l.org

run code in 300+ PHP versions simultaneously
<?php $source = ["a" => 1, "b" => 2, "c" => 3]; $input = ["d" => 4, "b" => 10]; echo "With + operator:\n"; echo "input + source | " . json_encode($input + $source) . PHP_EOL; echo "source + input | " . json_encode($source + $input) . PHP_EOL; echo "With array_merge:\n"; echo "input + source | " . json_encode(array_merge($input, $source)) . PHP_EOL; echo "source + input | " . json_encode(array_merge($source, $input)) . PHP_EOL;
Output for git.master, git.master_jit, rfc.property-hooks
With + operator: input + source | {"d":4,"b":10,"a":1,"c":3} source + input | {"a":1,"b":2,"c":3,"d":4} With array_merge: input + source | {"d":4,"b":2,"a":1,"c":3} source + input | {"a":1,"b":10,"c":3,"d":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:
100.51 ms | 406 KiB | 5 Q