public function indexOf(array $array, $searchElement, $fromIndex = null): int
    {
        if ($fromIndex !== null) {
            $array = array_slice($array, $fromIndex, null, true);
        }
        $result = array_search($searchElement, $array, true);
        if ($result === false) {
            return -1;
        }
        return $result;
    }
public function indexOf(array $array, $searchElement, $fromIndex = null): int
    {
        if ($fromIndex !== null) {
            $array = array_slice($array, $fromIndex, null, true);
        }
        $result = array_search($searchElement, $array, true);
        if ($result === false) {
            return -1;
        }
        return $result;
    }
public function indexOf ( array $ array , $ searchElement , $ fromIndex = null ) : int { if ( $ fromIndex !== null ) { $ array = array_slice ( $ array , $ fromIndex , null , true ) ; } $ result = array_search ( $ searchElement , $ array , true ) ; if ( $ result === false ) { return - 1 ; } return $ result ; }
Returns the first index at which a given element can be found in the array,
or -1 if it is not present

@param array $array The array
@param mixed $searchElement The element value to find
@param int $fromIndex Position in the array to start the search.
@return int
Returns the first index at which a given element can be found in the array or - 1 if it is not present