3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = ['A[1]', 'B[2]', 'C[2]', 'D[2]']; $b = ['B[3]', 'C[4]', 'E[4]', 'F[2]', 'G[2]']; var_export( array_values( array_reduce( array_merge($a, $b), function($result, $v) { $result[strtok($v, '[')] = $v; return $result; } ) ) );
Output for git.master, git.master_jit, rfc.property-hooks
array ( 0 => 'A[1]', 1 => 'B[3]', 2 => 'C[4]', 3 => 'D[2]', 4 => 'E[4]', 5 => 'F[2]', 6 => 'G[2]', )

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