3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $html = "<h1>á</h1>"; echo "before: ".$html; $dom = new DOMDocument(); $dom->loadHTML($html); $xpath = new DOMXPath($dom); $html=$dom->saveHTML(); echo " after: ".$html;
Output for 5.0.0 - 7.1.0
before: <h1>á</h1> after: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><body><h1>&Atilde;&iexcl;</h1></body></html>
Output for 4.3.2 - 4.4.9
before: <h1>á</h1> Fatal error: Cannot instantiate non-existent class: domdocument in /in/ajkYH on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
before: <h1>á</h1> Fatal error: Cannot instantiate non-existent class: domdocument in /in/ajkYH on line 6