<?php
$array = [
[2015 => '2015'],
[2016 => '2016'],
[2017 => '2017'],
[2018 => '2018'],
[2019 => '2019'],
[2020 => '2020'],
[2021 => '2021'],
[2022 => '2022'],
[2023 => '2023']
];
var_export(
array_reduce(
$array,
fn($result, $row) => array_replace($result, $row),
[]
)
);
- Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
- array (
2015 => '2015',
2016 => '2016',
2017 => '2017',
2018 => '2018',
2019 => '2019',
2020 => '2020',
2021 => '2021',
2022 => '2022',
2023 => '2023',
)
preferences:
65.27 ms | 402 KiB | 91 Q