3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = [ "old" => [ "uk" => "unik", "en" => "eng", "fr" => "fren" ], "new" => [ "uk" => "united kingdom", "en" => "english", "fr" => "french" ] ]; $output = []; $codes = ['uk', 'en', 'fr']; array_walk_recursive($arr, function ($value, $key) use (&$output) { $output[$key][] = $value; }); print_r($output);

preferences:
45.18 ms | 1534 KiB | 5 Q