HH\ImmVector::filter

Returns a ImmVector containing the values of the current ImmVector that meet a supplied condition.

Description

public function filter(
  (function(Tv):bool) $callback,
): ImmVector<Tv>

Returns a ImmVector containing the values of the current ImmVector that meet a supplied condition.

Only values that meet a certain criteria are affected by a call to filter(), while all values are affected by a call to map().

Parameters

  • (function(Tv):bool) $callback - The callback containing the condition to apply to the current ImmVector values.

Return Values

Examples

See Vector::filter for usage examples.