getid3_lib::intValueSupported

Advertisement

Syntax Syntax

getid3_lib::intValueSupported( int $num )

Parameters Parameters

$num

(Required)

Return Return

(bool)

Source Source

File: wp-includes/ID3/getid3.lib.php

	public static function intValueSupported($num) {
		// check if integers are 64-bit
		static $hasINT64 = null;
		if ($hasINT64 === null) { // 10x faster than is_null()
			$hasINT64 = is_int(pow(2, 31)); // 32-bit int are limited to (2^31)-1
			if (!$hasINT64 && !defined('PHP_INT_MIN')) {
				define('PHP_INT_MIN', ~PHP_INT_MAX);
			}
		}
		// if integers are 64-bit - no other check required
		if ($hasINT64 || (($num <= PHP_INT_MAX) && ($num >= PHP_INT_MIN))) { // phpcs:ignore PHPCompatibility.Constants.NewConstants.php_int_minFound
			return true;
		}
		return false;
	}

Advertisement

Advertisement

Leave a Reply