3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <p>รค</p> HTML; $doc = new DomDocument(1.0); $doc->loadHTML("\xef\xbb\xbf$html"); echo $doc->saveHTML();
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.23, 7.4.0 - 7.4.13, 8.0.0
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><body><p>&auml;</p></body></html>