HH\ImmVector::linearSearch

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

public function linearSearch(
  mixed $search_value,
): int;

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

Guide

Parameters

  • mixed $search_value - The value that will be searched for in the current ImmVector.

Returns

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

Examples

See Vector::linearSearch for usage examples.