3v4l.org

run code in 300+ PHP versions simultaneously
<?php $html = <<<HTML <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" id="mainLayout"> <head> <title>Anglosphere x3</title> <meta http-equiv="cache-control" content="max-age=0" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="expires" content="0" /> <meta http-equiv="imagetoolbar" content="no" /> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <meta name="content-language" content="en-US" /> <meta name="viewport" content="width=device-width" /> </head> </html> HTML; var_dump(simplexml_load_string($html));
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
object(SimpleXMLElement)#1 (2) { ["@attributes"]=> array(1) { ["id"]=> string(10) "mainLayout" } ["head"]=> object(SimpleXMLElement)#2 (2) { ["title"]=> string(14) "Anglosphere x3" ["meta"]=> array(7) { [0]=> object(SimpleXMLElement)#3 (1) { ["@attributes"]=> array(2) { ["http-equiv"]=> string(13) "cache-control" ["content"]=> string(9) "max-age=0" } } [1]=> object(SimpleXMLElement)#4 (1) { ["@attributes"]=> array(2) { ["http-equiv"]=> string(6) "pragma" ["content"]=> string(8) "no-cache" } } [2]=> object(SimpleXMLElement)#5 (1) { ["@attributes"]=> array(2) { ["http-equiv"]=> string(7) "expires" ["content"]=> string(1) "0" } } [3]=> object(SimpleXMLElement)#6 (1) { ["@attributes"]=> array(2) { ["http-equiv"]=> string(12) "imagetoolbar" ["content"]=> string(2) "no" } } [4]=> object(SimpleXMLElement)#7 (1) { ["@attributes"]=> array(2) { ["http-equiv"]=> string(12) "content-type" ["content"]=> string(24) "text/html; charset=UTF-8" } } [5]=> object(SimpleXMLElement)#8 (1) { ["@attributes"]=> array(2) { ["name"]=> string(16) "content-language" ["content"]=> string(5) "en-US" } } [6]=> object(SimpleXMLElement)#9 (1) { ["@attributes"]=> array(2) { ["name"]=> string(8) "viewport" ["content"]=> string(18) "width=device-width" } } } } }

preferences:
102.93 ms | 1782 KiB | 4 Q