3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php //$myfile = fopen("data.txt", "r") or die("Unable to open file!"); //$data=fread($myfile,filesize("data.txt")); //var_dump($data); $data="<root><top><data Level='1' Con='99%' TotalScore='82.60' Summarize='1111111111111111111。' SummarizeNoCapital='22222222222222222222222' HowToDo='333333333333333333' Info='444444444444444' IndustryType='more' SpecialTitle='' SpecialNewsID='0' CompanyDes='555555555555555' OperatingDes='6666666666666666666666666666'/></top><spider><data SBasic='8.5' SMsg='5.2' SIndustry='6.5' SMajor='9.5' STechBlock='4.5' STech='6.5' BBasic='6.9' BMsg='5.2' BIndustry='6.5' BMajor='5.6' BTechBlock='4.5' BTech='6.6'/></spider></root>"; var_dump(simplexml_load_string($data));
based on aU7WA
Output for 5.3.19 - 5.3.29, 5.5.27 - 5.5.35, 5.6.11 - 7.2.0
object(SimpleXMLElement)#1 (2) { ["top"]=> object(SimpleXMLElement)#2 (1) { ["data"]=> object(SimpleXMLElement)#4 (1) { ["@attributes"]=> array(12) { ["Level"]=> string(1) "1" ["Con"]=> string(3) "99%" ["TotalScore"]=> string(5) "82.60" ["Summarize"]=> string(22) "1111111111111111111。" ["SummarizeNoCapital"]=> string(23) "22222222222222222222222" ["HowToDo"]=> string(18) "333333333333333333" ["Info"]=> string(15) "444444444444444" ["IndustryType"]=> string(4) "more" ["SpecialTitle"]=> string(0) "" ["SpecialNewsID"]=> string(1) "0" ["CompanyDes"]=> string(15) "555555555555555" ["OperatingDes"]=> string(28) "6666666666666666666666666666" } } } ["spider"]=> object(SimpleXMLElement)#3 (1) { ["data"]=> object(SimpleXMLElement)#4 (1) { ["@attributes"]=> array(12) { ["SBasic"]=> string(3) "8.5" ["SMsg"]=> string(3) "5.2" ["SIndustry"]=> string(3) "6.5" ["SMajor"]=> string(3) "9.5" ["STechBlock"]=> string(3) "4.5" ["STech"]=> string(3) "6.5" ["BBasic"]=> string(3) "6.9" ["BMsg"]=> string(3) "5.2" ["BIndustry"]=> string(3) "6.5" ["BMajor"]=> string(3) "5.6" ["BTechBlock"]=> string(3) "4.5" ["BTech"]=> string(3) "6.6" } } } }
Output for 5.4.28 - 5.5.26, 5.6.8 - 5.6.10
object(SimpleXMLElement)#1 (2) { ["top"]=> object(SimpleXMLElement)#2 (1) { [0]=> object(SimpleXMLElement)#4 (1) { ["@attributes"]=> array(12) { ["Level"]=> string(1) "1" ["Con"]=> string(3) "99%" ["TotalScore"]=> string(5) "82.60" ["Summarize"]=> string(22) "1111111111111111111。" ["SummarizeNoCapital"]=> string(23) "22222222222222222222222" ["HowToDo"]=> string(18) "333333333333333333" ["Info"]=> string(15) "444444444444444" ["IndustryType"]=> string(4) "more" ["SpecialTitle"]=> string(0) "" ["SpecialNewsID"]=> string(1) "0" ["CompanyDes"]=> string(15) "555555555555555" ["OperatingDes"]=> string(28) "6666666666666666666666666666" } } } ["spider"]=> object(SimpleXMLElement)#3 (1) { ["data"]=> object(SimpleXMLElement)#4 (1) { ["@attributes"]=> array(12) { ["SBasic"]=> string(3) "8.5" ["SMsg"]=> string(3) "5.2" ["SIndustry"]=> string(3) "6.5" ["SMajor"]=> string(3) "9.5" ["STechBlock"]=> string(3) "4.5" ["STech"]=> string(3) "6.5" ["BBasic"]=> string(3) "6.9" ["BMsg"]=> string(3) "5.2" ["BIndustry"]=> string(3) "6.5" ["BMajor"]=> string(3) "5.6" ["BTechBlock"]=> string(3) "4.5" ["BTech"]=> string(3) "6.6" } } } }
Output for 5.4.9 - 5.4.27
object(SimpleXMLElement)#1 (2) { ["top"]=> object(SimpleXMLElement)#2 (1) { [0]=> object(SimpleXMLElement)#4 (1) { ["@attributes"]=> array(12) { ["Level"]=> string(1) "1" ["Con"]=> string(3) "99%" ["TotalScore"]=> string(5) "82.60" ["Summarize"]=> string(22) "1111111111111111111。" ["SummarizeNoCapital"]=> string(23) "22222222222222222222222" ["HowToDo"]=> string(18) "333333333333333333" ["Info"]=> string(15) "444444444444444" ["IndustryType"]=> string(4) "more" ["SpecialTitle"]=> string(0) "" ["SpecialNewsID"]=> string(1) "0" ["CompanyDes"]=> string(15) "555555555555555" ["OperatingDes"]=> string(28) "6666666666666666666666666666" } } } ["spider"]=> object(SimpleXMLElement)#3 (1) { [0]=> object(SimpleXMLElement)#4 (1) { ["@attributes"]=> array(12) { ["SBasic"]=> string(3) "8.5" ["SMsg"]=> string(3) "5.2" ["SIndustry"]=> string(3) "6.5" ["SMajor"]=> string(3) "9.5" ["STechBlock"]=> string(3) "4.5" ["STech"]=> string(3) "6.5" ["BBasic"]=> string(3) "6.9" ["BMsg"]=> string(3) "5.2" ["BIndustry"]=> string(3) "6.5" ["BMajor"]=> string(3) "5.6" ["BTechBlock"]=> string(3) "4.5" ["BTech"]=> string(3) "6.6" } } } }