Is there a shorthand for the following code:
Код: Выделить всё
$result = array_combine(array_map(fn($elem) => "key_$elem", $array), array_map(fn($elem) => "value_$elem", $array));
I do not like the idea (from readability point of view) of having to use array map twice on the same array and then combining the intermediate results.
Источник: https://stackoverflow.com/questions/781 ... re-derived