3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = "</ul>\n<p>\n Evaluation<!--[if gte mso 9]><xml>\n<o:OfficeDocumentSettings>\n<o:AllowPNG />\n<o:TargetScreenSize>1024x768</o:TargetScreenSize>\n</o:OfficeDocumentSettings>\n</xml><![endif]--><!--[if gte mso 9]><xml>\n<w:WordDocument>\n<w:View>Normal</w:View>\n<w:Zoom>0</w:Zoom>\n<w:HyphenationZone>21</w:HyphenationZone>\n<w:PunctuationKerning />\n<w:ValidateAgainstSchemas />\n<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>\n<w:IgnoreMixedContent>false</w:IgnoreMixedContent>\n<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>\n<w:Compatibility>\n<w:BreakWrappedTables />\n<w:SnapToGridInCell />\n<w:WrapTextWithPunct />\n<w:UseAsianBreakRules />\n<w:DontGrowAutofit />\n</w:Compatibility>\n</w:WordDocument>\n</xml><![endif]--><!--[if gte mso 9]><xml>\n<w:LatentStyles DefLockedState=\"false\" LatentStyleCount=\"156\">\n</w:LatentStyles>\n</xml><![endif]--><!--[if gte mso 10]>\n<style>\n/* Style Definitions */\ntable.MsoNormalTable\n{mso-style-name:\"Normale Tabelle\";\nmso-tstyle-rowband-size:0;\nmso-tstyle-colband-size:0;\nmso-style-noshow:yes;\nmso-style-parent:\"\";\nmso-padding-alt:0cm 5.4pt 0cm 5.4pt;\nmso-para-margin:0cm;\nmso-para-margin-bottom:.0001pt;\nmso-pagination:widow-orphan;\nfont-size:10.0pt;\nfont-family:\"Times New Roman\";\nmso-ansi-language:#0400;\nmso-fareast-language:#0400;\nmso-bidi-language:#0400;}\n</style>\n<![endif]--></p>\n<ul>\n <li>"; $dom = new DOMDocument; $dom->loadHtml($str); $xpath = new DOMXPath($dom); foreach ($xpath->query('//comment()') as $comment) { $comment->parentNode->removeChild($comment); } echo $dom->saveXML($str);
based on ACDGo
Output for 7.1.0 - 7.2.0
Warning: DOMDocument::loadHTML(): Unexpected end tag : ul in Entity, line: 1 in /in/tFGZp on line 6 Fatal error: Uncaught TypeError: Argument 1 passed to DOMDocument::saveXML() must be an instance of DOMNode or null, string given in /in/tFGZp:12 Stack trace: #0 /in/tFGZp(12): DOMDocument->saveXML('</ul>\n<p>\n E...') #1 {main} thrown in /in/tFGZp on line 12
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Warning: DOMDocument::loadHTML(): Unexpected end tag : ul in Entity, line: 1 in /in/tFGZp on line 6 Fatal error: Uncaught TypeError: Argument 1 passed to DOMDocument::saveXML() must be an instance of DOMNode, string given in /in/tFGZp:12 Stack trace: #0 /in/tFGZp(12): DOMDocument->saveXML('</ul>\n<p>\n E...') #1 {main} thrown in /in/tFGZp on line 12
Process exited with code 255.
Output for 5.3.21 - 5.6.28
Warning: DOMDocument::loadHTML(): Unexpected end tag : ul in Entity, line: 1 in /in/tFGZp on line 6 Catchable fatal error: Argument 1 passed to DOMDocument::saveXML() must be an instance of DOMNode, string given in /in/tFGZp on line 12
Process exited with code 255.