$filename = null,$config = null,$encoding = null,$useIncludePath = false新しい tidy オブジェクトを作成します。
filename
       もし filename パラメータが与えられた場合、
       この関数はファイルを読み込み、tidy_parse_file()
       のように実行してファイルに基づいたオブジェクトを初期化します。
      
config
       config には配列あるいは文字列を渡します。
       文字列を渡した場合は設定ファイルの名前、
       それ以外の場合は設定そのものとして解釈されます。
      
オプションについての説明は » http://api.html-tidy.org/#quick-reference を参照ください。
encoding
       encoding は入出力ドキュメントのエンコーディングを設定します。
       指定できるエンコーディング名は
       ascii、latin0、latin1、
       raw、utf8、iso2022、
       mac、win1252、ibm858、
       utf16、utf16le、utf16be、
       big5 および shiftjis です。
      
useIncludePathinclude_path からファイルを探します。
コンストラクタの宣言に失敗した時に例外をスローします。 (例 ファイルを開けなかった場合)
| バージョン | 説明 | 
|---|---|
| 8.4.0 | コンストラクタの実行に失敗した場合、使用できないオブジェクトを黙って作るのではなく、例外をスローするようになりました。 | 
| 8.0.0 | filename,config,encoding,useIncludePathは、nullable になりました。 | 
例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>
