private function filterByPhpVersion(array $versions)
    {
        $versionInfo = $this->getAvailableVersions();

        return array_filter($versions, function ($version) use ($versionInfo) {
            if (isset($versionInfo[$version]['php']['min'])
                && version_compare(PHP_VERSION, $versionInfo[$version]['php']['min'], '<')) {
                return false;
            } elseif (isset($versionInfo[$version]['php']['max'])
                && version_compare(PHP_VERSION, $versionInfo[$version]['php']['max'], '>')) {
                return false;
            }

            return true;
        });
    }
private function filterByPhpVersion(array $versions)
    {
        $versionInfo = $this->getAvailableVersions();

        return array_filter($versions, function ($version) use ($versionInfo) {
            if (isset($versionInfo[$version]['php']['min'])
                && version_compare(PHP_VERSION, $versionInfo[$version]['php']['min'], '<')) {
                return false;
            } elseif (isset($versionInfo[$version]['php']['max'])
                && version_compare(PHP_VERSION, $versionInfo[$version]['php']['max'], '>')) {
                return false;
            }

            return true;
        });
    }
private function filterByPhpVersion ( array $ versions ) { $ versionInfo = $ this -> getAvailableVersions ( ) ; return array_filter ( $ versions , function ( $ version ) use ( $ versionInfo ) { if ( isset ( $ versionInfo [ $ version ] [ 'php' ] [ 'min' ] ) && version_compare ( PHP_VERSION , $ versionInfo [ $ version ] [ 'php' ] [ 'min' ] , '<' ) ) { return false ; } elseif ( isset ( $ versionInfo [ $ version ] [ 'php' ] [ 'max' ] ) && version_compare ( PHP_VERSION , $ versionInfo [ $ version ] [ 'php' ] [ 'max' ] , '>' ) ) { return false ; } return true ; } ) ; }
Filter a list of versions to those that allow the current PHP version.

@param string[] $versions

@return string[]
Filter a list of versions to those that allow the current PHP version .