Debian Codegraph @

lib/3rdParty/composer/symfony/polyfill-php84/bootstrap.php

raw symbols SCIP
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <[email protected]>
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\Php84 as p;
13
14 if (\PHP_VERSION_ID >= 80400) {
15 return;
16 }
17
18 if (\extension_loaded('curl')) {
19 // CURL_VERSION_HTTP3 is defined by PHP 8.2+ when libcurl >= 7.66.0
20 if (defined('CURL_VERSION_HTTP3') || \PHP_VERSION_ID < 80200 && curl_version()['version_number'] >= 0x074200) {
21 if (!defined('CURL_HTTP_VERSION_3')) {
22 define('CURL_HTTP_VERSION_3', 30);
23 }
24
25 // CURL_HTTP_VERSION_3ONLY requires libcurl >= 7.88.0 and is not gated by any PHP-defined constant before 8.4
26 if (!defined('CURL_HTTP_VERSION_3ONLY') && curl_version()['version_number'] >= 0x075800) {
27 define('CURL_HTTP_VERSION_3ONLY', 31);
28 }
29 }
30 }
31
32 if (!function_exists('array_find')) {
33 function array_find(array $array, callable $callback) { return p\Php84::array_find($array, $callback); }
34 }
35
36 if (!function_exists('array_find_key')) {
37 function array_find_key(array $array, callable $callback) { return p\Php84::array_find_key($array, $callback); }
38 }
39
40 if (!function_exists('array_any')) {
41 function array_any(array $array, callable $callback): bool { return p\Php84::array_any($array, $callback); }
42 }
43
44 if (!function_exists('array_all')) {
45 function array_all(array $array, callable $callback): bool { return p\Php84::array_all($array, $callback); }
46 }
47
48 if (!function_exists('fpow')) {
49 function fpow(float $num, float $exponent): float { return p\Php84::fpow($num, $exponent); }
50 }
51
52 if (\PHP_VERSION_ID < 80000) {
53 require __DIR__.'/bootstrap72.php';
54 }
55
56 if (extension_loaded('mbstring')) {
57 if (!function_exists('mb_ucfirst')) {
58 function mb_ucfirst(?string $string, ?string $encoding = null): string { return p\Php84::mb_ucfirst((string) $string, $encoding); }
59 }
60
61 if (!function_exists('mb_lcfirst')) {
62 function mb_lcfirst(?string $string, ?string $encoding = null): string { return p\Php84::mb_lcfirst((string) $string, $encoding); }
63 }
64
65 if (!function_exists('mb_trim')) {
66 function mb_trim(?string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_trim((string) $string, $characters, $encoding); }
67 }
68
69 if (!function_exists('mb_ltrim')) {
70 function mb_ltrim(?string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_ltrim((string) $string, $characters, $encoding); }
71 }
72
73 if (!function_exists('mb_rtrim')) {
74 function mb_rtrim(?string $string, ?string $characters = null, ?string $encoding = null): string { return p\Php84::mb_rtrim((string) $string, $characters, $encoding); }
75 }
76 }
77
78 if (extension_loaded('bcmath')) {
79 if (!function_exists('bcceil')) {
80 function bcceil(string $num): string { return p\Php84::bcceil($num); }
81 }
82 if (!function_exists('bcdivmod')) {
83 function bcdivmod(string $num1, string $num2, ?int $scale = null): ?array { return p\Php84::bcdivmod($num1, $num2, $scale); }
84 }
85 if (!function_exists('bcfloor')) {
86 function bcfloor(string $num): string { return p\Php84::bcfloor($num); }
87 }
88 if (!function_exists('bcround')) {
89 function bcround(string $num, int $precision = 0, $mode = RoundingMode::HalfAwayFromZero): string { return p\Php84::bcround($num, $precision, $mode); }
90 }
91 }
92
93 if (\PHP_VERSION_ID >= 80200) {
94 return require __DIR__.'/bootstrap82.php';
95 }
96
97 if (extension_loaded('intl') && !function_exists('grapheme_str_split')) {
98 function grapheme_str_split(string $string, int $length = 1) { return p\Php84::grapheme_str_split($string, $length); }
99 }