bootstrap.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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\Php85 as p;
  11. if (\PHP_VERSION_ID >= 80500) {
  12. return;
  13. }
  14. if (!function_exists('get_error_handler')) {
  15. function get_error_handler(): ?callable { return p\Php85::get_error_handler(); }
  16. }
  17. if (!function_exists('get_exception_handler')) {
  18. function get_exception_handler(): ?callable { return p\Php85::get_exception_handler(); }
  19. }
  20. if (!function_exists('array_first')) {
  21. function array_first(array $array) { return p\Php85::array_first($array); }
  22. }
  23. if (!function_exists('array_last')) {
  24. function array_last(array $array) { return p\Php85::array_last($array); }
  25. }
  26. if (extension_loaded('intl') && !function_exists('locale_is_right_to_left')) {
  27. function locale_is_right_to_left(string $locale): bool { return p\Php85::locale_is_right_to_left($locale); }
  28. }
  29. if (\PHP_VERSION_ID >= 80000) {
  30. require __DIR__.'/bootstrap80.php';
  31. return;
  32. }
  33. if (extension_loaded('intl') && !function_exists('grapheme_levenshtein')) {
  34. function grapheme_levenshtein(string $string1, string $string2, int $insertion_cost = 1, int $replacement_cost = 1, int $deletion_cost = 1, string $locale = '') { return p\Php85::grapheme_levenshtein($string1, $string2, $insertion_cost, $replacement_cost, $deletion_cost); }
  35. }