@param $needle
@param $haystackId

@return bool
430217
protected function contains($needle, $haystackId)
    {
        $deps = $this->getDependencies($haystackId);
        if (!is_array($deps)) {
            return false;
        }

        return in_array($needle, $deps);
    }
138235
public static function contains($haystack, $needle)
    {
        foreach ((array)$needle as $n) {
            if (strpos($haystack, $n) !== false) {
                return true;
            }
        }

        return false;
    }
272412
public static function endsWith($haystack, $needle)
    {
        return $needle === '' or (($temp = mb_strlen($haystack) - mb_strlen($needle)) >= 0 and mb_strpos($haystack, $needle, $temp) !== false);
    }
842302
private static function arraySearch(string $needle, array $haystack): string
    {
        foreach ($haystack as $key => $value) {
            if ($needle === $value || (is_array($value) && self::arraySearch($needle, $value) !== '')) {
                return $key;
            }
        }

        return '';
    }
111756
public static function startsWith($haystack, $needle)
    {
        return $needle === '' or mb_strrpos($haystack, $needle, -mb_strlen($haystack)) !== false;
    }
1143622
public function starts_with( $haystack, $needle ) {
		if ( '' === $haystack || '' === $needle ) {
			return false;
		}
		if ( $haystack === $needle ) {
			return true;
		}

		return strncmp( $haystack, $needle, strlen( $needle ) ) === 0;
	}
819572
public static function inArrayCaseInsensitive($needle, $haystack)
    {
        if (!$haystack || !is_array($haystack)) {
            return false;
        }
        $lcase = array();
        foreach ($haystack as $key => $val) {
            $lcase[$key] = strtolower($val);
        }
        return in_array(strtolower($needle), $lcase);
    }
982161
public function startswith(string $haystack, string $needle) : bool
    {
        return (substr($haystack, 0, strlen($needle)) === $needle);
    }
1190505
public function beginsWith(string $haystack, string $needle): bool
    {
        return (!empty($needle) && 0 === strpos($haystack, $needle));
    }
29815
protected function fileEndsWith(string $haystack, string $needle): bool
    {
        $length = strlen($needle);
        if (strlen($haystack) < $length) {
            return $this->fileEndsWith($needle, $haystack);
        }

        $haystack = str_replace('\\', '/', $haystack);
        $needle = str_replace('\\', '/', $needle);
        
        return (substr($haystack, -$length) === $needle);
    }
1113406
public static function contains($needle, $haystack, $caseSensitive = true)
    {
        if (!self::isValid($haystack)) {
            return false;
        }

        list($needle, $haystack) = self::transformCase($needle, $haystack, $caseSensitive);

        return (mb_strpos($haystack, $needle) !== false);
    }
801148
protected function wasDispatched($needle, array $haystack)
    {
        foreach ($haystack as $dispatched) {
            if ((is_string($dispatched) && ($dispatched === $needle || is_subclass_of($dispatched, $needle))) ||
                $dispatched instanceof $needle) {
                return true;
            }
        }

        return false;
    }
828865
public function containsFilter($haystack, $needle)
    {
        if (empty($needle)) {
            return $haystack;
        }

        return (strpos($haystack, (string) $needle) !== false);
    }
244934
public function arraySearch($needle, $haystack)
    {
        if (empty($needle) || empty($haystack)) {
            return false;
        }

        foreach ($haystack as $key => $value) {
            $exists = 0;
            foreach ($needle as $nkey => $nvalue) {
                if (!empty($value[$nkey]) && $value[$nkey] === $nvalue) {
                    $exists = 1;
                } else {
                    $exists = 0;
                }
            }

            if ($exists) {
                return $key;
            }
        }

        return false;
    }
690571
public static function inString($needle, $haystack, $insensitive = false)
    {
        if ($insensitive) {
            return false !== stristr($haystack, $needle);
        }

        return false !== strpos($haystack, $needle);
    }
31724
public static function hasBeginning(string $needle, string $haystack): bool
    {
        return $needle === '' || strpos($haystack, $needle) === 0;
    }
1310778
public static function in($needle, ?array $haystack = null, bool $strict = true): bool
    {
        // prevent errors
        if (!Any::isArray($haystack) || $needle === null) {
            return false;
        }

        return in_array($needle, $haystack, $strict);
    }