array_map previously had it's signature rewritten based on the arity of the call, to match runtime behaviors including:

  • Preserving the input container type
  • Allowing for N args and accepting a function of the same arity
function array_map<Tk as arraykey, Tin, Tout>(
  (function(Tin): Tout) $callback,
  KeyedContainer<Tk, Tin> $arr,
): KeyedContainer<Tk, Tout>;

This runtime behavior still exists but this function is deprecated in favor of HSL functions like Vec\map or Dict\map.