3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ [2015 => '2015'], [2016 => '2016'], [2017 => '2017'], [2018 => '2018'], [2019 => '2019'], [2020 => '2020'], [2021 => '2021'], [2022 => '2022'], [2023 => '2023'] ]; $result = []; array_walk_recursive($years, function($v, $k) use (&$result) { $result[$k] = $v; }); var_export($result);
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
Fatal error: Uncaught TypeError: array_walk_recursive(): Argument #1 ($array) must be of type array, null given in /in/TQodA:16 Stack trace: #0 /in/TQodA(16): array_walk_recursive(NULL, Object(Closure)) #1 {main} thrown in /in/TQodA on line 16
Process exited with code 255.

preferences:
102.44 ms | 407 KiB | 5 Q