3v4l.org

run code in 150+ 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) . 'zzzzz</p></body> </html>'; $xml = new DOMDocument(); $xml->loadHTML($str); echo $xml->saveHTML();
Output for 5.3.3 - 5.6.28, 7.0.0 - 7.1.0
Warning: DOMDocument::loadHTML(): input conversion failed due to input error, bytes 0xAE 0x7A 0x7A 0x7A in /in/4gvfZ on line 12 Warning: DOMDocument::loadHTML(): input conversion failed due to input error, bytes 0xAE 0x7A 0x7A 0x7A in /in/4gvfZ on line 12 Warning: DOMDocument::loadHTML(): htmlCheckEncoding: encoder error in Entity, line: 4 in /in/4gvfZ on line 12 Warning: DOMDocument::loadHTML(): input conversion failed due to input error, bytes 0xAE 0x7A 0x7A 0x7A in /in/4gvfZ on line 12 <!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 hhvm-3.10.0 - 3.12.0
Warning: htmlCheckEncoding: encoder error in Entity, line: 4 <!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> encoding error : input conversion failed due to input error, bytes 0xAE 0x7A 0x7A 0x7A encoding error : input conversion failed due to input error, bytes 0xAE 0x7A 0x7A 0x7A encoding error : input conversion failed due to input error, bytes 0xAE 0x7A 0x7A 0x7A I/O error : encoder error
Output for 5.1.0 - 5.3.2
Warning: DOMDocument::loadHTML(): input conversion failed due to input error, bytes 0xAE 0x7A 0x7A 0x7A in /in/4gvfZ on line 12 Warning: DOMDocument::loadHTML(): input conversion failed due to input error, bytes 0xAE 0x7A 0x7A 0x7A in /in/4gvfZ on line 12 Warning: DOMDocument::loadHTML(): htmlCheckEncoding: encoder error in Entity, line: 4 in /in/4gvfZ on line 12 Warning: DOMDocument::loadHTML(): input conversion failed due to input error, bytes 0xAE 0x7A 0x7A 0x7A in /in/4gvfZ on line 12 <!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.0.5
Warning: input conversion failed due to input error, bytes 0xAE 0x7A 0x7A 0x7A in /in/4gvfZ on line 12 Warning: input conversion failed due to input error, bytes 0xAE 0x7A 0x7A 0x7A in /in/4gvfZ on line 12 Warning: DOMDocument::loadHTML(): htmlCheckEncoding: encoder error in Entity, line: 4 in /in/4gvfZ on line 12 Warning: input conversion failed due to input error, bytes 0xAE 0x7A 0x7A 0x7A in /in/4gvfZ on line 12 <!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/4gvfZ on line 11
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Cannot instantiate non-existent class: domdocument in /in/4gvfZ on line 11