34 if (is_object($haystack) || (
string)$haystack != $haystack || strlen($haystack) < 1) {
35 throw new \InvalidArgumentException(
36 '$haystack can not be interpreted as string or has no length',
40 if (is_object($needle) || (
string)$needle != $needle || strlen($needle) < 1) {
41 throw new \InvalidArgumentException(
42 '$needle can not be interpreted as string or has no length',
46 $stringLength = strlen($haystack);
47 $needleLength = strlen($needle);
48 return strrpos((
string) $haystack, (
string) $needle, 0) === $stringLength - $needleLength;
static isLastPartOfString($haystack, $needle)