Regenerate Composer auto-loader

This commit is contained in:
Frédéric Guillot
2022-09-04 22:13:36 -07:00
parent 4f3fcfee75
commit 2aad3ec03e
28 changed files with 602 additions and 614 deletions

View File

@@ -100,6 +100,16 @@ final class Php80
public static function str_ends_with(string $haystack, string $needle): bool
{
return '' === $needle || ('' !== $haystack && 0 === substr_compare($haystack, $needle, -\strlen($needle)));
if ('' === $needle || $needle === $haystack) {
return true;
}
if ('' === $haystack) {
return false;
}
$needleLength = \strlen($needle);
return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength);
}
}