function checkPhpVersion(int $pMajor, int $pMinor = NULL, int $pRelease = NULL)
    {
        $requirementsMet = TRUE;
        $phpVersion = \phpversion();
        $version = \explode('.', \phpversion());
        // fix minor version with tags, ex: 5.6.0-dev
        $version[2] = \str_replace('-dev', '', $version[2]);
        // Check the major version.
        if ($version[0] < $pMajor) {
            $requirementsMet = FALSE;
        } else if ($version[0] == $pMajor) {
            // Check the minor version if set.
            if (\is_int($pMinor) && $version[1] < $pMinor) {
                $requirementsMet = FALSE;
            } else if ($requirementsMet && \is_int($pMinor) && $version[1] == $pMinor) {
                // Check the release version if set.
                if (\is_int($pRelease) && $version[2] < $pRelease) {
                    $requirementsMet = FALSE;
                }
            }
        }
        // Throw the error when the required version is not met.
        if (!$requirementsMet) {
            $versionString = "{$pMajor}.{$pMinor}.{$pRelease}";
            $msg = "Your PHP version is '{$phpVersion}'. The minimum required"
                . "PHP version is '{$versionString}'. You'll need to upgrade in "
                . "order to use this application.";
            throw new \Exception($msg);
        }

        return $requirementsMet;
    }