1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-02-02 21:07:20 +01:00
vichan/inc/polyfill.php
2024-11-24 19:05:01 +01:00

11 lines
288 B
PHP

<?php
// PHP 8.0
if (!function_exists('str_starts_with')) {
function str_starts_with(string $haystack, string $needle): bool {
// https://wiki.php.net/rfc/add_str_starts_with_and_ends_with_functions#str_starts_with
return \strncmp($haystack, $needle, \strlen($needle)) === 0;
}
}