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