array_map

array_map signature is rewritten based on the arity of the call:

function array_map<Tk as arraykey, Tin, Tout>(
  (function(Tin): Tout) $callback,
  KeyedContainer<Tk, Tin> $arr,
): KeyedContainer<Tk, Tout>;

array_map(F, A1, A2, ..., An); becomes

array_map<T1, ... Tn, Tr>( (function(T1, ..., Tn): Tr), Container, ..., Container ): R;

where for n > 1, R = array for n = 1, R depends on actual type of container passed at the call site:

array -> R = array array -> R = array array<X, Y> -> R = array<X, Tr> Vector -> R = array KeyedContainer<X, Y> -> R = array<X, Tr> Container -> R = array<arraykey, Tr> X (unknown type) -> R = Y (other unknown type)

Parameters

Returns