Automattic\WooCommerce\Vendor\Symfony\Polyfill\Php80

Php80::str_ends_with │ public static │ WC 1.0

Метод класса: Php80{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$result = Php80::str_ends_with( $haystack, $needle ): bool;
$haystack(строка) (обязательный)
.
$needle(строка) (обязательный)
.

Код Php80::str_ends_with() WC 11.2.1

public static function str_ends_with(string $haystack, string $needle): bool
{
    if ('' === $needle || $needle === $haystack) {
        return true;
    }

    if ('' === $haystack) {
        return false;
    }

    $needleLength = \strlen($needle);

    return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength);
}