3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $doc = new DOMDocument(); $doc->loadHTML('<html> <head> </head> <body> <script> console.log("<h1>hello</h1>"); </script> </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: 6 in /in/2XufL on line 5 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><head></head><body> <script> console.log("<h1>hello"); </script></body></html>
Output for 5.4.0 - 7.0.12, 7.1.0
Warning: DOMDocument::loadHTML(): Unexpected end tag : h1 in Entity, line: 6 in /in/2XufL on line 13 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><head></head><body> <script> console.log("<h1>hello"); </script></body></html>