我一直在尋找到PHP整潔,我看到了下面的代碼爲什麼一些PHP對象轉換爲字符串
$tidy = new tidy;
$tidy->parseString($html, $config, 'utf8');
$tidy->cleanRepair();
// Output
echo $tidy;
Tidy
這裏是一個對象。爲什麼不投擲Catchable fatal error: Object of class tidy could not be converted to string
錯誤?
重載_toString():HTTPS://coderwall.com/p/nx3bka/magic-method-make-an-object-echoable –