3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ ['date' => '2017-08-22', 'AAA' => 1231], ['date' => '2017-08-21', 'AAA' => 1172], ['date' => '2017-08-20', 'AAA' => 1125], ['date' => '2017-08-21', 'BBB' => 251], ['date' => '2017-08-20', 'BBB' => 21773], ['date' => '2017-08-22', 'CCC' => 3750], ['date' => '2017-08-20', 'CCC' => 321750], ]; foreach ($array as $row) { $date = $row['date']; unset($row['date']); $result[$date] = array_merge($result[$date] ?? [], $row); } var_export($result);
Output for git.master, git.master_jit, rfc.property-hooks
array ( '2017-08-22' => array ( 'AAA' => 1231, 'CCC' => 3750, ), '2017-08-21' => array ( 'AAA' => 1172, 'BBB' => 251, ), '2017-08-20' => array ( 'AAA' => 1125, 'BBB' => 21773, 'CCC' => 321750, ), )

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