Resources
2 years ago
LICENSE
2 years ago
Php80.php
1 year ago
PhpToken.php
1 year ago
README.md
2 years ago
bootstrap.php
2 years ago
bootstrap.php
62 lines
| 1 | <?php |
| 2 | |
| 3 | namespace { |
| 4 | /* |
| 5 | * This file is part of the Symfony package. |
| 6 | * |
| 7 | * (c) Fabien Potencier <fabien@symfony.com> |
| 8 | * |
| 9 | * For the full copyright and license information, please view the LICENSE |
| 10 | * file that was distributed with this source code. |
| 11 | */ |
| 12 | use Symfony\Polyfill\Php80 as p; |
| 13 | if (\PHP_VERSION_ID >= 80000) { |
| 14 | return; |
| 15 | } |
| 16 | if (!\defined('FILTER_VALIDATE_BOOL') && \defined('FILTER_VALIDATE_BOOLEAN')) { |
| 17 | \define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); |
| 18 | } |
| 19 | if (!\function_exists('fdiv')) { |
| 20 | function fdiv(float $num1, float $num2) : float |
| 21 | { |
| 22 | return p\Php80::fdiv($num1, $num2); |
| 23 | } |
| 24 | } |
| 25 | if (!\function_exists('preg_last_error_msg')) { |
| 26 | function preg_last_error_msg() : string |
| 27 | { |
| 28 | return p\Php80::preg_last_error_msg(); |
| 29 | } |
| 30 | } |
| 31 | if (!\function_exists('str_contains')) { |
| 32 | function str_contains(?string $haystack, ?string $needle) : bool |
| 33 | { |
| 34 | return p\Php80::str_contains($haystack ?? '', $needle ?? ''); |
| 35 | } |
| 36 | } |
| 37 | if (!\function_exists('str_starts_with')) { |
| 38 | function str_starts_with(?string $haystack, ?string $needle) : bool |
| 39 | { |
| 40 | return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); |
| 41 | } |
| 42 | } |
| 43 | if (!\function_exists('str_ends_with')) { |
| 44 | function str_ends_with(?string $haystack, ?string $needle) : bool |
| 45 | { |
| 46 | return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); |
| 47 | } |
| 48 | } |
| 49 | if (!\function_exists('get_debug_type')) { |
| 50 | function get_debug_type($value) : string |
| 51 | { |
| 52 | return p\Php80::get_debug_type($value); |
| 53 | } |
| 54 | } |
| 55 | if (!\function_exists('get_resource_id')) { |
| 56 | function get_resource_id($resource) : int |
| 57 | { |
| 58 | return p\Php80::get_resource_id($resource); |
| 59 | } |
| 60 | } |
| 61 | } |
| 62 |