3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $doc = new \DOMDocument(); $doc->loadHTML(<<<EOF <p>Hello World!</p> <h2>Subtitle</h2> <table><tr><td>Hello in table!</td></tr></table> EOF , LIBXML_HTML_NOIMPLIED); echo $doc->saveHTML();
Output for 5.4.0 - 7.2.0
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <p>Hello World!<h2>Subtitle</h2><table><tr><td>Hello in table!</td></tr></table></p>
Output for 5.3.0 - 5.3.29
Notice: Use of undefined constant LIBXML_HTML_NOIMPLIED - assumed 'LIBXML_HTML_NOIMPLIED' in /in/4IKuE on line 9 Warning: DOMDocument::loadHTML() expects exactly 1 parameter, 2 given in /in/4IKuE on line 9
Output for 5.0.0 - 5.1.1, 5.1.3 - 5.2.17
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/4IKuE on line 3 Notice: Use of undefined constant LIBXML_HTML_NOIMPLIED - assumed 'LIBXML_HTML_NOIMPLIED' in /in/4IKuE on line 9 Warning: DOMDocument::loadHTML() expects exactly 1 parameter, 2 given in /in/4IKuE on line 9
Output for 5.1.2
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/4IKuE on line 3 Notice: Use of undefined constant LIBXML_HTML_NOIMPLIED - assumed 'LIBXML_HTML_NOIMPLIED' in /in/4IKuE on line 10 Warning: DOMDocument::loadHTML() expects exactly 1 parameter, 2 given in /in/4IKuE on line 10
Output for 4.3.2 - 4.4.9
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/4IKuE on line 3 Fatal error: Cannot instantiate non-existent class: domdocument in /in/4IKuE on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /in/4IKuE on line 3 Fatal error: Cannot instantiate non-existent class: domdocument in /in/4IKuE on line 3