protected static function parseReleases($html)
    {
        $releases         = array();
        $xmlErrorHandling = libxml_use_internal_errors(true);

        $dom = new DOMDocument();
        $dom->loadHTML($html);
        $xpath = new DOMXPath($dom);

        $nodes = self::getByClass('version', $xpath);
        foreach ($nodes as $node) {
            $version = $node->getAttribute('id');
            if (1 !== preg_match(self::SKIP_PATTERN, $version)) {
                $date      = '';
                $dateNodes = self::getByClass('releasedate', $xpath, $node);
                foreach ($dateNodes as $dateNode) {
                    $date = $dateNode->getAttribute('datetime');
                }
                $releases[$version] = empty($date) ? '' : $date;
            }
        }

        libxml_clear_errors();
        libxml_use_internal_errors($xmlErrorHandling);

        return (array)$releases;
    }
protected static function parseReleases($html)
    {
        $releases         = array();
        $xmlErrorHandling = libxml_use_internal_errors(true);

        $dom = new DOMDocument();
        $dom->loadHTML($html);
        $xpath = new DOMXPath($dom);

        $nodes = self::getByClass('version', $xpath);
        foreach ($nodes as $node) {
            $version = $node->getAttribute('id');
            if (1 !== preg_match(self::SKIP_PATTERN, $version)) {
                $date      = '';
                $dateNodes = self::getByClass('releasedate', $xpath, $node);
                foreach ($dateNodes as $dateNode) {
                    $date = $dateNode->getAttribute('datetime');
                }
                $releases[$version] = empty($date) ? '' : $date;
            }
        }

        libxml_clear_errors();
        libxml_use_internal_errors($xmlErrorHandling);

        return (array)$releases;
    }
protected static function parseReleases ( $ html ) { $ releases = array ( ) ; $ xmlErrorHandling = libxml_use_internal_errors ( true ) ; $ dom = new DOMDocument ( ) ; $ dom -> loadHTML ( $ html ) ; $ xpath = new DOMXPath ( $ dom ) ; $ nodes = self :: getByClass ( 'version' , $ xpath ) ; foreach ( $ nodes as $ node ) { $ version = $ node -> getAttribute ( 'id' ) ; if ( 1 !== preg_match ( self :: SKIP_PATTERN , $ version ) ) { $ date = '' ; $ dateNodes = self :: getByClass ( 'releasedate' , $ xpath , $ node ) ; foreach ( $ dateNodes as $ dateNode ) { $ date = $ dateNode -> getAttribute ( 'datetime' ) ; } $ releases [ $ version ] = empty ( $ date ) ? '' : $ date ; } } libxml_clear_errors ( ) ; libxml_use_internal_errors ( $ xmlErrorHandling ) ; return ( array ) $ releases ; }
Parse a PHP change log web page to extract PHP releases.

@since 0.1.0

@param string $html HTML of a PHP change log web page.

@return array Array of strings that represent existing PHP version numbers.
Parse a PHP change log web page to extract PHP releases .