bootstrap80.php 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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((string) $haystack, (int) $size, (int) $type, (int) $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((string) $haystack, (string) $needle, (int) $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((string) $haystack, (string) $needle, (bool) $beforeNeedle); }
  28. }
  29. if (!function_exists('grapheme_strlen')) {
  30. function grapheme_strlen(?string $string): int|false|null { return p\Grapheme::grapheme_strlen((string) $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((string) $haystack, (string) $needle, (int) $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((string) $haystack, (string) $needle, (int) $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((string) $haystack, (string) $needle, (int) $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((string) $haystack, (string) $needle, (bool) $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) $string, (int) $offset, $length); }
  46. }