Crypt/Base: improve ARM detection code

This commit is contained in:
terrafrost 2023-10-07 17:36:50 -05:00
parent 6cd6e8ceab
commit 173bb38e67
1 changed files with 2 additions and 2 deletions

View File

@ -537,13 +537,13 @@ class Crypt_Base
if (!defined('CRYPT_BASE_USE_REG_INTVAL')) {
switch (true) {
// PHP 5.3, per http://php.net/releases/5_3_0.php, introduced "more consistent float rounding"
case version_compare(PHP_VERSION, '5.3.0') >= 0 && (php_uname('m') & "\xDF\xDF\xDF") != 'ARM':
case version_compare(PHP_VERSION, '5.3.0') >= 0 && !(is_string(php_uname('m')) && (php_uname('m') & "\xDF\xDF\xDF") == 'ARM'):
// PHP_OS & "\xDF\xDF\xDF" == strtoupper(substr(PHP_OS, 0, 3)), but a lot faster
case (PHP_OS & "\xDF\xDF\xDF") === 'WIN':
case PHP_INT_SIZE == 8:
define('CRYPT_BASE_USE_REG_INTVAL', true);
break;
case (php_uname('m') & "\xDF\xDF\xDF") == 'ARM':
case is_string(php_uname('m')) && (php_uname('m') & "\xDF\xDF\xDF") == 'ARM':
switch (true) {
// PHP_VERSION_ID wasn't a constant until PHP 5.2.7
case version_compare(PHP_VERSION, '5.3.0') < 1: