3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-7"> <title>test</title> </head> <body><p>aaaaa' . chr(0xAE) . chr(0xE3) . chr(0x80) . chr(0x90) .chr(0xE8) . 'zzzzz</p></body> </html>'; $content = utf8_encode( $str ); $xml = new DOMDocument(); @$xml->loadHTML($content); echo $xml->saveHTML();
based on 4H7M7
Output for 5.3.3 - 7.2.0
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html><head><meta http-equiv="content-type" content="text/html; charset=iso-8859-7"><title>test</title></head><body><p>aaaaa�</p></body></html>
Output for 5.0.0 - 5.3.2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-7"> <title>test</title> </head> <body><p>aaaaa�</p></body> </html>
Output for 4.3.2 - 4.4.9
Fatal error: Cannot instantiate non-existent class: domdocument in /in/C1s0I on line 15
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: domdocument in /in/C1s0I on line 15