3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $doc = new DOMDocument(); $doc->loadHTML("<html><body class=\"<!--invalid-->class\">>Test<!--valid--><br<!--invalid2-->></body></html<!--invalid3-->>"); var_dump($doc->saveHTML());
Output for 5.6.30, 7.0.30 - 7.3.0rc3
Warning: DOMDocument::loadHTML(): error parsing attribute name in Entity, line: 1 in /in/K3ZFk on line 4 Warning: DOMDocument::loadHTML(): End tag : expected '>' in Entity, line: 1 in /in/K3ZFk on line 4 string(229) "<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><body class="<!--invalid-->class">&gt;Test<!--valid--><br>&gt;</body><html><p>&gt;</p></html></html><!--invalid3--> "
Output for hhvm-3.22.0
Warning: error parsing attribute name in Entity, line: 1 in /in/K3ZFk on line -1 Warning: End tag : expected '>' in Entity, line: 1 in /in/K3ZFk on line -1 string(229) "<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><body class="<!--invalid-->class">&gt;Test<!--valid--><br>&gt;</body><html><p>&gt;</p></html></html><!--invalid3--> "
Output for hhvm-3.21.3
Warning: error parsing attribute name in Entity, line: 1 in /in/K3ZFk on line 4 Warning: End tag : expected '>' in Entity, line: 1 in /in/K3ZFk on line 4 string(229) "<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><body class="<!--invalid-->class">&gt;Test<!--valid--><br>&gt;</body><html><p>&gt;</p></html></html><!--invalid3--> "
Output for hhvm-3.18.5
Warning: error parsing attribute name in Entity, line: 1 Warning: End tag : expected '>' in Entity, line: 1 string(229) "<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"> <html><body class="<!--invalid-->class">&gt;Test<!--valid--><br>&gt;</body><html><p>&gt;</p></html></html><!--invalid3--> "