You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.5 KiB

3 years ago
  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\Php80 as p;
  11. if (\PHP_VERSION_ID >= 80000) {
  12. return;
  13. }
  14. if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) {
  15. define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN);
  16. }
  17. if (!function_exists('fdiv')) {
  18. function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); }
  19. }
  20. if (!function_exists('preg_last_error_msg')) {
  21. function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); }
  22. }
  23. if (!function_exists('str_contains')) {
  24. function str_contains(string $haystack, string $needle): bool { return p\Php80::str_contains($haystack, $needle); }
  25. }
  26. if (!function_exists('str_starts_with')) {
  27. function str_starts_with(string $haystack, string $needle): bool { return p\Php80::str_starts_with($haystack, $needle); }
  28. }
  29. if (!function_exists('str_ends_with')) {
  30. function str_ends_with(string $haystack, string $needle): bool { return p\Php80::str_ends_with($haystack, $needle); }
  31. }
  32. if (!function_exists('get_debug_type')) {
  33. function get_debug_type($value): string { return p\Php80::get_debug_type($value); }
  34. }
  35. if (!function_exists('get_resource_id')) {
  36. function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); }
  37. }