3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = '<A>AAA</A> <B>BBB</B> <param>Param</param> <c>CCC</c> <span>span</span> <div>div</div> <notbug>notbug</notbug> <test>test</test>'; $doc = new DOMDocument('1.0', 'UTF-8'); $doc->preserveWhiteSpace = false; // libxml_use_internal_errors(true); $doc->recover = true; $doc->strictErrorChecking = false; $doc->loadHTML($html); echo $doc->saveXML() . PHP_EOL; echo $doc->saveHTML() . PHP_EOL;
Output for git.master, git.master_jit, rfc.property-hooks
Warning: DOMDocument::loadHTML(): Unexpected end tag : param in Entity, line: 3 in /in/CLtKU on line 17 Warning: DOMDocument::loadHTML(): Tag c invalid in Entity, line: 4 in /in/CLtKU on line 17 Warning: DOMDocument::loadHTML(): Tag notbug invalid in Entity, line: 7 in /in/CLtKU on line 17 Warning: DOMDocument::loadHTML(): Tag test invalid in Entity, line: 8 in /in/CLtKU on line 17 <?xml version="1.0" standalone="yes"?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><body><a>AAA</a> <b>BBB</b> <param/>Param <c>CCC</c><span>span</span> <div>div</div> <notbug>notbug</notbug><test>test</test></body></html> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><body><a>AAA</a> <b>BBB</b> <param>Param <c>CCC</c><span>span</span> <div>div</div> <notbug>notbug</notbug><test>test</test></body></html>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
26.75 ms | 408 KiB | 5 Q