3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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>'));
based on IKrRO
Output for 5.3.20 - 5.3.29, 5.5.27 - 5.5.35, 5.6.11 - 7.2.0
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" } } } } } }
Output for 5.4.10 - 5.5.26, 5.6.8 - 5.6.10
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" } } } } } }