original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: 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
docstring_tokens: Parse an array of words and returns an IPv6 instance if the array is valid or null otherwise .