3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $b = array(array('id' => 1, 'fid' => 2), array('id' => 2, 'fid' => 2)); $map = array(); foreach($b as $record) { $map[$record['id']][] = $record; }
based on K2GYY
Output for 4.3.0 - 7.2.0