original_string: protected function elements($code)
      {
          libxml_use_internal_errors(true);
  
          $doc = new \DOMDocument;
  
          $doc->loadHTML((string) $code);
  
          $tag = (string) $this->tagname;
  
          $items = $doc->getElementsByTagName($tag);
  
          $items = iterator_to_array($items);
  
          return count($items) > 0 ? $items : array();
      }
code: protected function elements($code)
      {
          libxml_use_internal_errors(true);
  
          $doc = new \DOMDocument;
  
          $doc->loadHTML((string) $code);
  
          $tag = (string) $this->tagname;
  
          $items = $doc->getElementsByTagName($tag);
  
          $items = iterator_to_array($items);
  
          return count($items) > 0 ? $items : array();
      }
code_tokens: protected function elements ( $ code ) { libxml_use_internal_errors ( true ) ; $ doc = new \ DOMDocument ; $ doc -> loadHTML ( ( string ) $ code ) ; $ tag = ( string ) $ this -> tagname ; $ items = $ doc -> getElementsByTagName ( $ tag ) ; $ items = iterator_to_array ( $ items ) ; return count ( $ items ) > 0 ? $ items : array ( ) ; }
docstring: Returns elements by a tag name.
  
  @param  string $code
  @return \DOMNodeList
docstring_tokens: Returns elements by a tag name .