๐ฅ๏ธ Server: LiteSpeed
๐ป System: Linux s20058.bom1.stableserver.net 5.14.0-611.55.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue May 19 15:19:29 EDT 2026 x86_64
๐ค User: skhata (1324)
๐ PHP: 8.4.20
๐ซ Disabled: โจ NONE
๐ Php85.php
๐ Path: /home/skhata/chandrasons.com/vendor/symfony/polyfill-php85/Php85.php
๐ Size: 5.35 KB
๐ Perm: 0644
๐ MIME: text/x-php
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Polyfill\Php85;
/**
* @author Pierre Ambroise <pierre27.ambroise@gmail.com>
* @author Alexander Schranz <alexander@sulu.io>
*
* @internal
*/
final class Php85
{
public static function get_error_handler(): ?callable
{
$handler = set_error_handler(null);
restore_error_handler();
return $handler;
}
public static function get_exception_handler(): ?callable
{
$handler = set_exception_handler(null);
restore_exception_handler();
return $handler;
}
public static function array_first(array $array)
{
foreach ($array as $value) {
return $value;
}
return null;
}
public static function array_last(array $array)
{
return $array ? current(\array_slice($array, -1)) : null;
}
private const RTL_SCRIPTS = [
'Adlm' => true, 'Arab' => true, 'Armi' => true, 'Hebr' => true,
'Mand' => true, 'Mani' => true, 'Mend' => true, 'Nkoo' => true,
'Orkh' => true, 'Phnx' => true, 'Rohg' => true, 'Samr' => true,
'Syrc' => true, 'Thaa' => true, 'Yezi' => true,
];
private const LANG_TO_SCRIPT = [
'ar' => 'Arab',
'ckb' => 'Arab',
'dv' => 'Thaa',
'fa' => 'Arab',
'he' => 'Hebr',
'ku' => 'Arab',
'nqo' => 'Nkoo',
'ps' => 'Arab',
'sd' => 'Arab',
'ug' => 'Arab',
'ur' => 'Arab',
'yi' => 'Hebr',
];
public static function locale_is_right_to_left(string $locale): bool
{
if ('' === $locale) {
return false;
}
$parts = preg_split('/[_-]/', $locale);
$language = strtolower($parts[0]);
foreach ($parts as $part) {
if (4 === \strlen($part) && ctype_alpha($part)) {
return isset(self::RTL_SCRIPTS[ucfirst(strtolower($part))]);
}
}
return isset(self::LANG_TO_SCRIPT[$language]) && isset(self::RTL_SCRIPTS[self::LANG_TO_SCRIPT[$language]]);
}
public static function grapheme_levenshtein(string $s1, string $s2, int $insertion_cost = 1, int $replacement_cost = 1, int $deletion_cost = 1)
{
if (!preg_match('//u', $s1) || !preg_match('//u', $s2)) {
return false;
}
if (0 > $insertion_cost || 0 > $replacement_cost || 0 > $deletion_cost) {
throw new \ValueError('grapheme_levenshtein(): Argument #3 ($insertion_cost), #4 ($replacement_cost), and #5 ($deletion_cost) must be greater than or equal to 0');
}
$regex = ((float) \PCRE_VERSION < 10 ? (float) \PCRE_VERSION >= 8.32 : (float) \PCRE_VERSION >= 10.39)
? '\X'
: '(?:\r\n|(?:[ -~\x{200C}\x{200D}]|[แจ-แน]+|[แ-แ
]*(?:[๊ฐ๊ฐ๊ฐธ๊ฑ๊ฑฐ๊ฒ๊ฒจ๊ณ๊ณ ๊ณผ๊ด๊ดด๊ต๊ตฌ๊ถ๊ถค๊ท๊ท๊ทธ๊ธ๊ธฐ๊น๊นจ๊บ๊บ ๊บผ๊ป๊ปด๊ผ๊ผฌ๊ฝ๊ฝค๊พ๊พ๊พธ๊ฟ๊ฟฐ๋๋จ๋๋ ๋ผ๋๋ด๋๋ฌ๋๋ค๋
๋
๋
ธ๋๋ฐ๋๋จ๋๋ ๋ผ๋๋ด๋๋ฌ๋๋ค๋๋๋ธ๋๋ฐ๋๋จ๋๋ ๋ผ๋๋ด๋๋ฌ๋๋ค๋๋๋ธ๋๋ฐ๋๋จ๋๋ ๋ผ๋๋ด๋๋ฌ๋๋ค๋๋๋ธ๋๋ฐ๋๋จ๋๋ ๋ผ๋๋ด๋๋ฌ๋ ๋ ค๋ก๋ก๋กธ๋ข๋ขฐ๋ฃ๋ฃจ๋ค๋ค ๋คผ๋ฅ๋ฅด๋ฆ๋ฆฌ๋ง๋งค๋จ๋จ๋จธ๋ฉ๋ฉฐ๋ช๋ชจ๋ซ๋ซ ๋ซผ๋ฌ๋ฌด๋ญ๋ญฌ๋ฎ๋ฎค๋ฏ๋ฏ๋ฏธ๋ฐ๋ฐฐ๋ฑ๋ฑจ๋ฒ๋ฒ ๋ฒผ๋ณ๋ณด๋ด๋ดฌ๋ต๋ตค๋ถ๋ถ๋ถธ๋ท๋ทฐ๋ธ๋ธจ๋น๋น ๋นผ๋บ๋บด๋ป๋ปฌ๋ผ๋ผค๋ฝ๋ฝ๋ฝธ๋พ๋พฐ๋ฟ๋ฟจ์์ ์ผ์์ด์์ฌ์์ค์์์ธ์
์
ฐ์์จ์์ ์ผ์์ด์์ฌ์์ค์์์ธ์์ฐ์์จ์์ ์ผ์์ด์์ฌ์์ค์์์ธ์์ฐ์์จ์์ ์ผ์์ด์์ฌ์์ค์์์ธ์์ฐ์์จ์์ ์ผ์์ด์์ฌ์์ค์ ์ ์ ธ์ก์กฐ์ข์ขจ์ฃ์ฃ ์ฃผ์ค์คด์ฅ์ฅฌ์ฆ์ฆค์ง์ง์งธ์จ์จฐ์ฉ์ฉจ์ช์ช ์ชผ์ซ์ซด์ฌ์ฌฌ์ญ์ญค์ฎ์ฎ์ฎธ์ฏ์ฏฐ์ฐ์ฐจ์ฑ์ฑ ์ฑผ์ฒ์ฒด์ณ์ณฌ์ด์ดค์ต์ต์ตธ์ถ์ถฐ์ท์ทจ์ธ์ธ ์ธผ์น์นด์บ์บฌ์ป์ปค์ผ์ผ์ผธ์ฝ์ฝฐ์พ์พจ์ฟ์ฟ ์ฟผํํดํํฌํํคํํํธํํฐํ
ํ
จํํ ํผํํดํํฌํํคํํํธํํฐํํจํํ ํผํํดํํฌํํคํํํธํํฐํํจํํ ํผํํดํํฌํํคํํํธํํฐํํจํํ ํผํํดํํฌํ]?[แ
-แข]+|[๊ฐ-ํฃ])[แจ-แน]*|[แ-แ
]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{200D}\x{1D165}\x{1D16E}-\x{1D172}]*|[\p{Cc}\p{Cf}\p{Zl}\p{Zp}])';
preg_match_all('/'.$regex.'/u', $s1, $s1);
preg_match_all('/'.$regex.'/u', $s2, $s2);
$s1 = $s1[0];
$s2 = $s2[0];
$l1 = \count($s1);
$l2 = \count($s2);
if (0 === $l1) {
return $l2 * $insertion_cost;
}
if (0 === $l2) {
return $l1 * $deletion_cost;
}
$dp = array_fill(0, $l1 + 1, array_fill(0, $l2 + 1, 0));
for ($i = 1; $i <= $l1; ++$i) {
$dp[$i][0] = $dp[$i - 1][0] + $deletion_cost;
}
for ($j = 1; $j <= $l2; ++$j) {
$dp[0][$j] = $dp[0][$j - 1] + $insertion_cost;
}
for ($i = 1; $i <= $l1; ++$i) {
for ($j = 1; $j <= $l2; ++$j) {
$cost = ($s1[$i - 1] === $s2[$j - 1]) ? 0 : $replacement_cost;
$dp[$i][$j] = min($dp[$i - 1][$j] + $deletion_cost, $dp[$i][$j - 1] + $insertion_cost, $dp[$i - 1][$j - 1] + $cost);
}
}
return $dp[$l1][$l2];
}
}
โจ File Manager Magic โจ