3v4l.org

run code in 300+ PHP versions simultaneously
<?php $first = array ( 0 => array ( 'id' => 5, 'name' => 'Education' ), 1 => array ( 'id' => 4, 'name' => 'Computers' ), 3 => array ( 'id' => 7, 'name' => 'Science' ), 4 => array ( 'id' => 1, 'name' => 'Sports' ), ); $second = array ( 0 => array ( 'id' => 1, 'title' => 'Sport' ), 1 => array ( 'id' => 7, 'title' => 'Sci' ), 3 => array ( 'id' => 4, 'title' => 'Comp' ), 4 => array ( 'id' => 5, 'title' => 'Edu' ), ); $second = array_column($second, null, 'id'); foreach ($first as &$subject) { $subject += $second[$subject['id']] ?? []; } print_r($first);
Output for git.master, git.master_jit, rfc.property-hooks
Array ( [0] => Array ( [id] => 5 [name] => Education [title] => Edu ) [1] => Array ( [id] => 4 [name] => Computers [title] => Comp ) [3] => Array ( [id] => 7 [name] => Science [title] => Sci ) [4] => Array ( [id] => 1 [name] => Sports [title] => Sport ) )

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:
130.23 ms | 406 KiB | 5 Q