original_string: public static function tag($tag, $attr = [], $html = '')
      {
          // Build attributes
          $attributes = [];
          foreach ($attr as $name => $value) {
              $attributes[] = $name.'="'.$value.'"';
          }
  
          if (in_array($tag, self::$voidElements)) {
              return '<'.$tag.(!empty($attributes) ? ' '.implode(' ', $attributes) : '').'>';
          } else {
              return '<'.$tag.(!empty($attributes) ? ' '.implode(' ', $attributes) : '').'>'.$html.'</'.$tag.'>';
          }
      }
code: public static function tag($tag, $attr = [], $html = '')
      {
          // Build attributes
          $attributes = [];
          foreach ($attr as $name => $value) {
              $attributes[] = $name.'="'.$value.'"';
          }
  
          if (in_array($tag, self::$voidElements)) {
              return '<'.$tag.(!empty($attributes) ? ' '.implode(' ', $attributes) : '').'>';
          } else {
              return '<'.$tag.(!empty($attributes) ? ' '.implode(' ', $attributes) : '').'>'.$html.'</'.$tag.'>';
          }
      }
code_tokens: public static function tag ( $ tag , $ attr = [ ] , $ html = '' ) { // Build attributes $ attributes = [ ] ; foreach ( $ attr as $ name => $ value ) { $ attributes [ ] = $ name . '="' . $ value . '"' ; } if ( in_array ( $ tag , self :: $ voidElements ) ) { return '<' . $ tag . ( ! empty ( $ attributes ) ? ' ' . implode ( ' ' , $ attributes ) : '' ) . '>' ; } else { return '<' . $ tag . ( ! empty ( $ attributes ) ? ' ' . implode ( ' ' , $ attributes ) : '' ) . '>' . $ html . '</' . $ tag . '>' ; } }
docstring: Generate the HTML code for an element.
  
  @param string $tag  <tag>
  @param array  $attr The tag attributes
  @param string $html The tag HTML content
  
  @return string HTML code of the tag
docstring_tokens: Generate the HTML code for an element .