3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = [10, 2, 5, 10, 0]; $b = [1, 20, 11, 8, 3]; var_export( array_reduce( array_keys($b), fn ($result, $k) => array_replace($result, [$k => ($result[$k] ?? 0) + $b[$k]]), $a ) );
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 11, 1 => 22, 2 => 16, 3 => 18, 4 => 3, )

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:
75.66 ms | 405 KiB | 5 Q