function AbstractString::indexOfLast
Parameters
string|string[] $needle:
8 calls to AbstractString::indexOfLast()
- AbstractString::afterLast in vendor/
symfony/ string/ AbstractString.php - AbstractString::beforeLast in vendor/
symfony/ string/ AbstractString.php - ByteString::indexOfLast in vendor/
symfony/ string/ ByteString.php - ByteString::indexOfLast in vendor/
symfony/ string/ ByteString.php - CodePointString::indexOfLast in vendor/
symfony/ string/ CodePointString.php
3 methods override AbstractString::indexOfLast()
- ByteString::indexOfLast in vendor/
symfony/ string/ ByteString.php - CodePointString::indexOfLast in vendor/
symfony/ string/ CodePointString.php - UnicodeString::indexOfLast in vendor/
symfony/ string/ UnicodeString.php
File
-
vendor/
symfony/ string/ AbstractString.php, line 362
Class
- AbstractString
- Represents a string of abstract characters.
Namespace
Symfony\Component\StringCode
public function indexOfLast(string|iterable $needle, int $offset = 0) : ?int {
if (\is_string($needle)) {
throw new \TypeError(\sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class));
}
$i = null;
foreach ($needle as $n) {
$j = $this->indexOfLast((string) $n, $offset);
if (null !== $j && $j >= $i) {
$i = $offset = $j;
}
}
return $i;
}