3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $doc = new DOMDocument(); $doc->loadHTML('<html> <head> <script> console.log("<h1>hello</h1>"); </script> </head> <body> </body> </html>'); echo $doc->saveHTML();
Output for 7.0.20, 7.1.5 - 7.2.0
Warning: DOMDocument::loadHTML(): Unexpected end tag : h1 in Entity, line: 4 in /in/8YneA on line 4 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><head><script> console.log("<h1>hello"); </script></head><body> </body></html>
Output for 5.3.19 - 7.0.6, 7.1.0
Warning: DOMDocument::loadHTML(): Unexpected end tag : h1 in Entity, line: 4 in /in/8YneA on line 13 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><head><script> console.log("<h1>hello"); </script></head><body> </body></html>