HH\ImmVector::linearSearch

Returns the index of the first element that matches the search value.

Description

public function linearSearch(
  Tu $search_value,
): int

Returns the index of the first element that matches the search value.

If no element matches the search value, this function returns -1.

Parameters

  • Tu $search_value - The value that will be search for in the current ImmVector.

Return Values

  • int - The key (index) where that value is found; -1 if it is not found.

Examples

See Vector::linearSearch for usage examples.