3v4l.org

run code in 300+ PHP versions simultaneously
<?php $foo = Array ( 1 => 'nanananana,lol,', 2 => 'laaaaalalalala,asd,', 3 => 'r0tfl,lmfao,ahah,' ); $bar = Array ( 1 => 'dunnoWhat,write,', 3 => 'hello,wooorld,' ); $result = array_diff_key($foo, $bar) + array_combine( $y = array_keys(array_intersect_key($foo, $bar)), array_map(function($x) use ($foo, $bar) { return $foo[$x]."\n".$bar[$x]; }, $y) ) + array_diff_key($bar, $foo); var_dump($result);
Output for git.master, git.master_jit, rfc.property-hooks
array(3) { [2]=> string(19) "laaaaalalalala,asd," [1]=> string(32) "nanananana,lol, dunnoWhat,write," [3]=> string(32) "r0tfl,lmfao,ahah, hello,wooorld," }

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