$filename
   [, mixed $config
   [, string $encoding
   [, bool $use_include_path
  ]]]] )新しい tidy オブジェクトを作成します。
filename
       もし filename パラメータが与えられた場合、
       この関数はファイルを読み込み、tidy_parse_file()
       のように実行してファイルに基づいたオブジェクトを初期化します。
      
config
       config には配列あるいは文字列を渡します。
       文字列を渡した場合は設定ファイルの名前、
       それ以外の場合は設定そのものとして解釈されます。
      
オプションについての説明は » http://tidy.sourceforge.net/docs/quickref.html を参照ください。
encoding
       encoding は入出力ドキュメントのエンコーディングを設定します。
       指定できるエンコーディング名は
       ascii、latin0、latin1、
       raw、utf8、iso2022、
       mac、win1252、ibm858、
       utf16、utf16le、utf16be、
       big5 および shiftjis です。
      
use_include_pathinclude_path からファイルを探します。
新しい tidy インスタンスを返します。
例1 tidy::__construct() の例
<?php
$html = <<< HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title>title</title></head>
<body>
<p>paragraph <bt />
text</p>
</body></html>
HTML;
$tidy = new tidy();
$tidy->ParseString($html);
$tidy->cleanRepair();
if ($tidy->errorBuffer) {
    echo "The following errors were detected:\n";
    echo $tidy->errorBuffer;
}
?>
上の例の出力は以下となります。
The following errors were detected: line 8 column 14 - Error: <bt> is not recognized! line 8 column 14 - Warning: discarding unexpected <bt>