3v4l.org

run code in 300+ PHP versions simultaneously
<?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();
Output for 8.2.9 - 8.2.18, 8.3.0 - 8.3.6
Deprecated: Function utf8_encode() is deprecated in /in/C1s0I on line 14 <!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"></head></html>
Output for 8.2.0 - 8.2.8
Deprecated: Function utf8_encode() is deprecated in /in/C1s0I on line 14 <!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"></head></html>
Output for 8.0.30, 8.1.22 - 8.1.28
<!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"></head></html>
Output for 7.3.32 - 7.3.33, 7.4.26 - 7.4.33, 8.0.13 - 8.0.29, 8.1.0 - 8.1.21
<!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"></head></html>
Output for 5.3.3 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 8.0.0 - 8.0.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, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.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.3.11, 4.4.0 - 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

preferences:
263.37 ms | 401 KiB | 327 Q