| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
* This file is part of the Symfony package. |
| 5 |
* |
| 6 |
* (c) Fabien Potencier <[email protected]> |
| 7 |
* |
| 8 |
* For the full copyright and license information, please view the LICENSE |
| 9 |
* file that was distributed with this source code. |
| 10 |
*/ |
| 11 |
|
| 12 |
use Symfony\Polyfill\Intl\Grapheme as p; |
| 13 |
|
| 14 |
if (\PHP_VERSION_ID >= 80000) { |
| 15 |
return require __DIR__.'/bootstrap80.php'; |
| 16 |
} |
| 17 |
|
| 18 |
if (!defined('GRAPHEME_EXTR_COUNT')) { |
| 19 |
define('GRAPHEME_EXTR_COUNT', 0); |
| 20 |
} |
| 21 |
if (!defined('GRAPHEME_EXTR_MAXBYTES')) { |
| 22 |
define('GRAPHEME_EXTR_MAXBYTES', 1); |
| 23 |
} |
| 24 |
if (!defined('GRAPHEME_EXTR_MAXCHARS')) { |
| 25 |
define('GRAPHEME_EXTR_MAXCHARS', 2); |
| 26 |
} |
| 27 |
|
| 28 |
if (!function_exists('grapheme_extract')) { |
| 29 |
function grapheme_extract($haystack, $size, $type = 0, $start = 0, &$next = 0) { return p\Grapheme::grapheme_extract($haystack, $size, $type, $start, $next); } |
| 30 |
} |
| 31 |
if (!function_exists('grapheme_stripos')) { |
| 32 |
function grapheme_stripos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_stripos($haystack, $needle, $offset); } |
| 33 |
} |
| 34 |
if (!function_exists('grapheme_stristr')) { |
| 35 |
function grapheme_stristr($haystack, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_stristr($haystack, $needle, $beforeNeedle); } |
| 36 |
} |
| 37 |
if (!function_exists('grapheme_strlen')) { |
| 38 |
function grapheme_strlen($input) { return p\Grapheme::grapheme_strlen($input); } |
| 39 |
} |
| 40 |
if (!function_exists('grapheme_strpos')) { |
| 41 |
function grapheme_strpos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strpos($haystack, $needle, $offset); } |
| 42 |
} |
| 43 |
if (!function_exists('grapheme_strripos')) { |
| 44 |
function grapheme_strripos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strripos($haystack, $needle, $offset); } |
| 45 |
} |
| 46 |
if (!function_exists('grapheme_strrpos')) { |
| 47 |
function grapheme_strrpos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strrpos($haystack, $needle, $offset); } |
| 48 |
} |
| 49 |
if (!function_exists('grapheme_strstr')) { |
| 50 |
function grapheme_strstr($haystack, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_strstr($haystack, $needle, $beforeNeedle); } |
| 51 |
} |
| 52 |
if (!function_exists('grapheme_substr')) { |
| 53 |
function grapheme_substr($string, $offset, $length = null) { return p\Grapheme::grapheme_substr($string, $offset, $length); } |
| 54 |
} |
| 55 |
if (!function_exists('grapheme_str_split')) { |
| 56 |
function grapheme_str_split(string $string, int $length = 1) { return p\Grapheme::grapheme_str_split($string, $length); } |
| 57 |
} |
| 58 |
if (!function_exists('grapheme_levenshtein')) { |
| 59 |
function grapheme_levenshtein(string $string1, string $string2, int $insertion_cost = 1, int $replacement_cost = 1, int $deletion_cost = 1, string $locale = '') { return p\Grapheme::grapheme_levenshtein($string1, $string2, $insertion_cost, $replacement_cost, $deletion_cost); } |
| 60 |
} |
| 61 |
if (!function_exists('grapheme_strrev')) { |
| 62 |
function grapheme_strrev(string $string) { return p\Grapheme::grapheme_strrev($string); } |
| 63 |
} |