3v4l.org

run code in 300+ PHP versions simultaneously
<?php $document = <<<EOD <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head> <body> < </body> </html> EOD; $dom = new \DOMDocument(); $dom->loadHTML($document, LIBXML_NOBLANKS); echo $dom->textContent . PHP_EOL; echo LIBXML_DOTTED_VERSION;
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
Warning: DOMDocument::loadHTML(): htmlParseStartTag: invalid element name in Entity, line: 5 in /in/bBP3r on line 13 2.9.4

preferences:
79.76 ms | 407 KiB | 5 Q