3v4l.org

run code in 300+ PHP versions simultaneously
<?php $houses = [ ['id' => 332, 'title' => 'biba'], ['id' => 2222, 'title' => 'boba'], ['id' => 5566, 'title' => 'aboba'], ]; $result = array_map( fn(array $item) => [$item['id'] => $item['title']], $houses ); print_r($result);
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Array ( [0] => Array ( [332] => biba ) [1] => Array ( [2222] => boba ) [2] => Array ( [5566] => aboba ) )

preferences:
81.64 ms | 403 KiB | 59 Q