If the given version is available, true is returned.

@param string $version
@return boolean
494371
public function isVersionAvailable($version)
    {
        if ($this->availableVersions === null) {
            $this->registerAvailableVersions();
        }
        return isset($this->availableVersions[$version]);
    }
617099
public boolean isModifiedOnVersion(String version) {
		if (version == null || version.isEmpty()) {
			return true;
		}
		return version.equalsIgnoreCase(this.version);
	}
341543
public function selectVersion($version)
	{
		if ( ! in_array($version, $this->versions))
		{
			// not a value version
			return false;
		}

		$this->version = $version;

		return $this;
	}
278237
public static function check_edge_version($version = null) {
        $useragent = self::get_user_agent_string();

        if ($useragent === false) {
            // No User Agent found.
            return false;
        }

        if (strpos($useragent, 'Edge/') === false) {
            // Edge was not found in the UA - this is not Edge.
            return false;
        }

        if (empty($version)) {
            // No version to check.
            return true;
        }

        // Find the version.
        // Edge versions are always in the format:
        //      Edge/<version>.<OS build number>
        preg_match('%Edge/([\d]+)\.(.*)$%', $useragent, $matches);

        // Just to be safe, round the version being tested.
        // Edge only uses integer versions - the second component is the OS build number.
        $version = round($version);

        // Check whether the version specified is >= the version found.
        return version_compare($matches[1], $version, '>=');
    }
867841
public function getDetectedVersion($version)
    {
        return isset($this->detectedVersions[$version]) ? $this->detectedVersions[$version] : null;
    }
57981
protected static function cleanExtraVersion($version)
    {
        $pos = strpos($version, '-');

        if (false !== $pos) {
            $version = substr($version, 0, $pos);
        }

        return $version;
    }
923435
protected function isVersionNumeric($version)
    {
        foreach (explode('.', $version) as $part) {
            if (!is_numeric($part)) {
                return false;
            }
        }

        return true;
    }
1004599
public function compareVersions($version1, $version2)
    {
        $versions = $this->getVersions();
        $key1 = array_search($version1, $versions);
        $key2 = array_search($version2, $versions);

        if ($key1 === false ||
             $key2 === false)
        {
            return 0;
        }

        return $key1 - $key2;
    }
298630
protected function isVersioned()
    {
        if (!class_exists(Versioned::class)) {
            return false;
        }
        /** @var Versioned|DataObject $singleton */
        $singleton = DataObject::singleton($this->getBaseClass());
        return $singleton->hasExtension(Versioned::class) && $singleton->hasStages();
    }
1130783
public function setVersion($version)
    {
        if (!in_array($version, $this->supportedVersions)) {
            $this->throwError('The version ' . $version . ' is not supported by this library');
        }

        $this->version = $version;

        return $this;
    }
1077433
protected function setVersion($version)
    {
        // Set version of browser
        $this->version = $version;

        // If major and minor versions hasn't been set
        // we'll set them by parsing version.
        //
        // If version doesn't contain a "." then we'll only
        // set the major version.
        if (empty($this->majorVersion) && strpos($version, '.') !== false) {
            // Split version by comma
            $version = explode('.', $version);

            // Set major and minor version
            $this->majorVersion = (int) isset($version[0]) ? $version[0] : 0;
            $this->minorVersion = (int) isset($version[1]) ? $version[1] : 0;
        } else {
            $this->majorVersion = (int) $version;
        }

        return $this;
    }
1301005
public static function getByVersionNumber($version)
    {
        $updates = id(new Update())->getLocalAvailableUpdates();
        foreach ($updates as $up) {
            if ($up->getUpdateVersion() == $version) {
                return $up;
            }
        }
    }
480957
public function supportsVersion(Version $version) : bool
    {
        try {
            $this->getVersionUrl($version);
        } catch (UnsupportedVersionException $e) {
            return false;
        }

        return true;
    }
861566
public function hasVersionMigrated(Version $version)
    {
        $this->createMigrationCollection();

        $record = $this->getCollection()->findOne(['v' => $version->getVersion()]);

        return null !== $record;
    }
1018328
static public function isKnown($version)
    {
        $version = self::appendPatchVersion($version);
        return in_array($version, self::knownVersions());
    }
1372263
private function comparePhingVersion($version)
    {
        $current = strtolower(self::getPhingVersion());
        $current = trim(str_replace('phing', '', $current));

        // make sure that version checks are not applied to trunk
        if ('dev' === $current) {
            return 1;
        }

        if (-1 == version_compare($current, $version)) {
            throw new BuildException(
                sprintf('Incompatible Phing version (%s). Version "%s" required.', $current, $version)
            );
        }
    }
1355288
public function withProtocolVersion($version)
    {
        Validator::checkProtocolVersion($version);
        $instance = clone $this;
        $instance->protocol = $version;

        return $instance;
    }