3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a1 = [ ['v' => '13', 't' => '2015-09-08 18:50:00'], ['v' => '25', 't' => '2015-09-08 19:00:00'], ['v' => '34', 't' => '2015-09-08 19:05:00'], ['v' => '24', 't' => '2015-09-08 19:10:00'] ]; $a2 = [ ['v' => '10', 't' => '2015-09-08 18:50:00'], ['v' => '29', 't' => '2015-09-08 18:55:00'], ['v' => '17', 't' => '2015-09-08 19:00:00'] ]; $result =[]; foreach ($a1 as $row) { $result[$row['t']] = [ 'v1' => $row['v'], 'v2' => null, 't' => $row['t'] ]; } foreach ($a2 as $row) { if (isset($result[$row['t']])) { $result[$row['t']]['v2'] = $row['v']; } else { $result[$row['t']] = [ 'v1' => null, 'v2' => $row['v'], 't' => $row['t'] ]; } } ksort($result); var_export(array_values($result));
Output for git.master_jit, git.master, rfc.property-hooks
array ( 0 => array ( 'v1' => '13', 'v2' => '10', 't' => '2015-09-08 18:50:00', ), 1 => array ( 'v1' => NULL, 'v2' => '29', 't' => '2015-09-08 18:55:00', ), 2 => array ( 'v1' => '25', 'v2' => '17', 't' => '2015-09-08 19:00:00', ), 3 => array ( 'v1' => '34', 'v2' => NULL, 't' => '2015-09-08 19:05:00', ), 4 => array ( 'v1' => '24', 'v2' => NULL, 't' => '2015-09-08 19:10:00', ), )

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