set php 7.4 patch alternative

This commit is contained in:
crazywhalecc
2023-04-22 15:58:24 +08:00
parent fa437644f5
commit 61a76dc0c9
2 changed files with 22 additions and 3 deletions

18
src/SPC/util/Util.php Normal file
View File

@@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace SPC\util;
class Util
{
/**
* Get current PHP version ID (downloaded)
*/
public static function getPHPVersionID(): int
{
$file = file_get_contents(SOURCE_PATH . '/php-src/main/php_version.h');
preg_match('/PHP_VERSION_ID (\d+)/', $file, $match);
return intval($match[1]);
}
}