public static function lastIndexOf($str, $search, $startPos = 0)
    {
        $result = self::validateIndexOf($str, $search, $startPos);
        if (true !== $result) {
            return $result;
        }

        if (true === self::isEmpty($search)) {
            return $startPos;
        }

        $pos = \strrpos($str, $search, $startPos);

        return (false === $pos)
            ? -1
            : $pos;
    }