bootstrap80.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. use Symfony\Polyfill\Intl\Grapheme as p;
  11. if (!defined('GRAPHEME_EXTR_COUNT')) {
  12. define('GRAPHEME_EXTR_COUNT', 0);
  13. }
  14. if (!defined('GRAPHEME_EXTR_MAXBYTES')) {
  15. define('GRAPHEME_EXTR_MAXBYTES', 1);
  16. }
  17. if (!defined('GRAPHEME_EXTR_MAXCHARS')) {
  18. define('GRAPHEME_EXTR_MAXCHARS', 2);
  19. }
  20. if (!function_exists('grapheme_extract')) {
  21. function grapheme_extract(string $haystack, int $size, int $type = GRAPHEME_EXTR_COUNT, int $offset = 0, &$next = null): string|false { return p\Grapheme::grapheme_extract($haystack, $size, $type, $offset, $next); }
  22. }
  23. if (!function_exists('grapheme_stripos')) {
  24. function grapheme_stripos(string $haystack, string $needle, int $offset = 0): int|false { return p\Grapheme::grapheme_stripos($haystack, $needle, $offset); }
  25. }
  26. if (!function_exists('grapheme_stristr')) {
  27. function grapheme_stristr(string $haystack, string $needle, bool $beforeNeedle = false): string|false { return p\Grapheme::grapheme_stristr($haystack, $needle, $beforeNeedle); }
  28. }
  29. if (!function_exists('grapheme_strlen')) {
  30. function grapheme_strlen(string $string): int|false|null { return p\Grapheme::grapheme_strlen($string); }
  31. }
  32. if (!function_exists('grapheme_strpos')) {
  33. function grapheme_strpos(string $haystack, string $needle, int $offset = 0): int|false { return p\Grapheme::grapheme_strpos($haystack, $needle, $offset); }
  34. }
  35. if (!function_exists('grapheme_strripos')) {
  36. function grapheme_strripos(string $haystack, string $needle, int $offset = 0): int|false { return p\Grapheme::grapheme_strripos($haystack, $needle, $offset); }
  37. }
  38. if (!function_exists('grapheme_strrpos')) {
  39. function grapheme_strrpos(string $haystack, string $needle, int $offset = 0): int|false { return p\Grapheme::grapheme_strrpos($haystack, $needle, $offset); }
  40. }
  41. if (!function_exists('grapheme_strstr')) {
  42. function grapheme_strstr(string $haystack, string $needle, bool $beforeNeedle = false): string|false { return p\Grapheme::grapheme_strstr($haystack, $needle, $beforeNeedle); }
  43. }
  44. if (!function_exists('grapheme_substr')) {
  45. function grapheme_substr(string $string, int $offset, int $length = null): string|false { return p\Grapheme::grapheme_substr($string, $offset, $length); }
  46. }