function ByteString::indexOf
Overrides AbstractString::indexOf
File
-
vendor/
symfony/ string/ ByteString.php, line 174
Class
- ByteString
- Represents a binary-safe string of bytes.
Namespace
Symfony\Component\StringCode
public function indexOf(string|iterable|AbstractString $needle, int $offset = 0) : ?int {
if ($needle instanceof AbstractString) {
$needle = $needle->string;
}
elseif (!\is_string($needle)) {
return parent::indexOf($needle, $offset);
}
if ('' === $needle) {
return null;
}
$i = $this->ignoreCase ? stripos($this->string, $needle, $offset) : strpos($this->string, $needle, $offset);
return false === $i ? null : $i;
}