3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(simplexml_load_string('<root> <text name="123" value="123"/> <fql name=""> </fql> <dataset> <group> <control-group id="0 - dD" name=""> <control id="1 - Name"/> </control-group> </group> </dataset> </root>'));
Output for 5.5.24 - 5.5.26, 5.6.8 - 5.6.10, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
object(SimpleXMLElement)#1 (3) { ["text"]=> object(SimpleXMLElement)#2 (1) { ["@attributes"]=> array(2) { ["name"]=> string(3) "123" ["value"]=> string(3) "123" } } ["fql"]=> object(SimpleXMLElement)#3 (1) { ["@attributes"]=> array(1) { ["name"]=> string(0) "" } } ["dataset"]=> object(SimpleXMLElement)#4 (1) { ["group"]=> object(SimpleXMLElement)#5 (1) { ["control-group"]=> object(SimpleXMLElement)#6 (2) { ["@attributes"]=> array(2) { ["id"]=> string(6) "0 - dD" ["name"]=> string(0) "" } ["control"]=> object(SimpleXMLElement)#7 (1) { ["@attributes"]=> array(1) { ["id"]=> string(8) "1 - Name" } } } } } }
Output for 5.5.27 - 5.5.35, 5.6.11 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33
object(SimpleXMLElement)#1 (3) { ["text"]=> object(SimpleXMLElement)#2 (1) { ["@attributes"]=> array(2) { ["name"]=> string(3) "123" ["value"]=> string(3) "123" } } ["fql"]=> object(SimpleXMLElement)#3 (2) { ["@attributes"]=> array(1) { ["name"]=> string(0) "" } [0]=> string(4) " " } ["dataset"]=> object(SimpleXMLElement)#4 (1) { ["group"]=> object(SimpleXMLElement)#5 (1) { ["control-group"]=> object(SimpleXMLElement)#6 (2) { ["@attributes"]=> array(2) { ["id"]=> string(6) "0 - dD" ["name"]=> string(0) "" } ["control"]=> object(SimpleXMLElement)#7 (1) { ["@attributes"]=> array(1) { ["id"]=> string(8) "1 - Name" } } } } } }

preferences:
149.98 ms | 404 KiB | 184 Q