3v4l.org

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