public static function fromWords(array $words)
    {
        $result = null;
        if (count($words) === 8) {
            $chunks = array();
            for ($i = 0; $i < 8; ++$i) {
                $word = $words[$i];
                if (is_int($word) && $word >= 0 && $word <= 0xffff) {
                    $chunks[] = sprintf('%04x', $word);
                } else {
                    $chunks = null;
                    break;
                }
            }
            if ($chunks !== null) {
                $result = new static(implode(':', $chunks));
            }
        }

        return $result;
    }
public static function fromWords(array $words)
    {
        $result = null;
        if (count($words) === 8) {
            $chunks = array();
            for ($i = 0; $i < 8; ++$i) {
                $word = $words[$i];
                if (is_int($word) && $word >= 0 && $word <= 0xffff) {
                    $chunks[] = sprintf('%04x', $word);
                } else {
                    $chunks = null;
                    break;
                }
            }
            if ($chunks !== null) {
                $result = new static(implode(':', $chunks));
            }
        }

        return $result;
    }
public static function fromWords ( array $ words ) { $ result = null ; if ( count ( $ words ) === 8 ) { $ chunks = array ( ) ; for ( $ i = 0 ; $ i < 8 ; ++ $ i ) { $ word = $ words [ $ i ] ; if ( is_int ( $ word ) && $ word >= 0 && $ word <= 0xffff ) { $ chunks [ ] = sprintf ( '%04x' , $ word ) ; } else { $ chunks = null ; break ; } } if ( $ chunks !== null ) { $ result = new static ( implode ( ':' , $ chunks ) ) ; } } return $ result ; }
Parse an array of words and returns an IPv6 instance if the array is valid, or null otherwise.

@param int[]|array $words

@return static|null
Parse an array of words and returns an IPv6 instance if the array is valid or null otherwise .