3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $xml_string= '<data page="http://mp3.zing.vn/"> <duration><![CDATA[ 255 ]]></duration> <item type="mp3"> <title><![CDATA[ Hạnh Phúc Xa Bay ]]></title> <performer><![CDATA[Bằng Cường ]]></performer> <link><![CDATA[ http://mp3.zing.vn/tim-kiem/bai-hat.html?q=B%E1%BA%B1ng+C%C6%B0%E1%BB%9Dng ]]></link> <source><![CDATA[http://mp3.zing.vn/xml/load-song/MjAxNSUyRjExJTJGMjUlMkYzJTJGNCUyRjM0MTRmMDkwZmJmMjZkNmFjMTc2ZDM4YWFlOWM3MDQ4Lm1wMyU3QzEz]]></source> <hq><![CDATA[require vip]]></hq> <lyric><![CDATA[]]></lyric> <mvlink><![CDATA[]]></mvlink> <adparam><![CDATA[cid=a_1075438689]]></adparam> <backimage><![CDATA[http://image.mp3.zdn.vn/cover3_artist/9/b/9b6265d156600f6e34b0078f73daf550_1411712231.jpg]]></backimage> <errorcode>0</errorcode> <errormessage></errormessage> </item> <item type="mp3"> <title><![CDATA[ Uống Cho Say ]]></title> <performer><![CDATA[Bằng Cường ]]></performer> <link><![CDATA[ http://mp3.zing.vn/tim-kiem/bai-hat.html?q=B%E1%BA%B1ng+C%C6%B0%E1%BB%9Dng ]]></link> <source><![CDATA[http://mp3.zing.vn/xml/load-song/MjAxNSUyRjExJTJGMjUlMkY1JTJGMyUyRjUzZjJhMzYwOTNiZTBmYzdkZjhhMjNmZjVhODYyZmUxLm1wMyU3QzEz]]></source> <hq><![CDATA[require vip]]></hq> <lyric><![CDATA[]]></lyric> <mvlink><![CDATA[]]></mvlink> <adparam><![CDATA[cid=a_1075438690]]></adparam> <backimage><![CDATA[http://image.mp3.zdn.vn/cover3_artist/9/b/9b6265d156600f6e34b0078f73daf550_1411712231.jpg]]></backimage> <errorcode>0</errorcode> <errormessage></errormessage> </item> <item type="mp3"> <title><![CDATA[ Anh Không Thể ]]></title> <performer><![CDATA[Bằng Cường ]]></performer> <link><![CDATA[ http://mp3.zing.vn/tim-kiem/bai-hat.html?q=B%E1%BA%B1ng+C%C6%B0%E1%BB%9Dng ]]></link> <source><![CDATA[http://mp3.zing.vn/xml/load-song/MjAxNSUyRjExJTJGMjUlMkYyJTJGOSUyRjI5NGMzZDg1ZTk4YzE4YjNjMmMzYTVjMjdkODc0MGFkLm1wMyU3QzEz]]></source> <hq><![CDATA[require vip]]></hq> <lyric><![CDATA[]]></lyric> <mvlink><![CDATA[]]></mvlink> <adparam><![CDATA[cid=a_1075438691]]></adparam> <backimage><![CDATA[http://image.mp3.zdn.vn/cover3_artist/9/b/9b6265d156600f6e34b0078f73daf550_1411712231.jpg]]></backimage> <errorcode>0</errorcode> <errormessage></errormessage> </item> <item type="mp3"> <title><![CDATA[ Mèo Con ]]></title> <performer><![CDATA[Bằng Cường ]]></performer> <link><![CDATA[ http://mp3.zing.vn/tim-kiem/bai-hat.html?q=B%E1%BA%B1ng+C%C6%B0%E1%BB%9Dng ]]></link> <source><![CDATA[http://mp3.zing.vn/xml/load-song/MjAxNSUyRjExJTJGMjUlMkZmJTJGNSUyRmY1ZmMxYWRmMjQyY2E3ZGFhYTcxYTQ2NGQyM2Y5ZjI5Lm1wMyU3QzEz]]></source> <hq><![CDATA[require vip]]></hq> <lyric><![CDATA[]]></lyric> <mvlink><![CDATA[]]></mvlink> <adparam><![CDATA[cid=a_1075438692]]></adparam> <backimage><![CDATA[http://image.mp3.zdn.vn/cover3_artist/9/b/9b6265d156600f6e34b0078f73daf550_1411712231.jpg]]></backimage> <errorcode>0</errorcode> <errormessage></errormessage> </item> </data>'; $xml = simplexml_load_string($xml_string);//print_r($xml); $xml2 = simplexml_load_file('http://mp3.zing.vn/xml/album-xml/kHJmTZmaVRFQkCstkbJtDnLn');print_r($xml2); $json = json_encode($xml); $array = json_decode($json,TRUE); print_r($array);
based on TOTDY
Output for 7.0.20, 7.1.5 - 7.2.0
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: System error in /in/Xmo3t on line 59 Warning: simplexml_load_file(http://mp3.zing.vn/xml/album-xml/kHJmTZmaVRFQkCstkbJtDnLn): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/Xmo3t on line 59 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://mp3.zing.vn/xml/album-xml/kHJmTZmaVRFQkCstkbJtDnLn" in /in/Xmo3t on line 59 Array ( [@attributes] => Array ( [page] => http://mp3.zing.vn/ ) [duration] => Array ( ) [item] => Array ( [0] => Array ( [@attributes] => Array ( [type] => mp3 ) [title] => Array ( ) [performer] => Array ( ) [link] => Array ( ) [source] => Array ( ) [hq] => Array ( ) [lyric] => Array ( ) [mvlink] => Array ( ) [adparam] => Array ( ) [backimage] => Array ( ) [errorcode] => 0 [errormessage] => Array ( ) ) [1] => Array ( [@attributes] => Array ( [type] => mp3 ) [title] => Array ( ) [performer] => Array ( ) [link] => Array ( ) [source] => Array ( ) [hq] => Array ( ) [lyric] => Array ( ) [mvlink] => Array ( ) [adparam] => Array ( ) [backimage] => Array ( ) [errorcode] => 0 [errormessage] => Array ( ) ) [2] => Array ( [@attributes] => Array ( [type] => mp3 ) [title] => Array ( ) [performer] => Array ( ) [link] => Array ( ) [source] => Array ( ) [hq] => Array ( ) [lyric] => Array ( ) [mvlink] => Array ( ) [adparam] => Array ( ) [backimage] => Array ( ) [errorcode] => 0 [errormessage] => Array ( ) ) [3] => Array ( [@attributes] => Array ( [type] => mp3 ) [title] => Array ( ) [performer] => Array ( ) [link] => Array ( ) [source] => Array ( ) [hq] => Array ( ) [lyric] => Array ( ) [mvlink] => Array ( ) [adparam] => Array ( ) [backimage] => Array ( ) [errorcode] => 0 [errormessage] => Array ( ) ) ) )
Output for 5.5.0 - 7.0.9, 7.1.0
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/Xmo3t on line 59 Warning: simplexml_load_file(http://mp3.zing.vn/xml/album-xml/kHJmTZmaVRFQkCstkbJtDnLn): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/Xmo3t on line 59 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://mp3.zing.vn/xml/album-xml/kHJmTZmaVRFQkCstkbJtDnLn" in /in/Xmo3t on line 59 Array ( [@attributes] => Array ( [page] => http://mp3.zing.vn/ ) [duration] => Array ( ) [item] => Array ( [0] => Array ( [@attributes] => Array ( [type] => mp3 ) [title] => Array ( ) [performer] => Array ( ) [link] => Array ( ) [source] => Array ( ) [hq] => Array ( ) [lyric] => Array ( ) [mvlink] => Array ( ) [adparam] => Array ( ) [backimage] => Array ( ) [errorcode] => 0 [errormessage] => Array ( ) ) [1] => Array ( [@attributes] => Array ( [type] => mp3 ) [title] => Array ( ) [performer] => Array ( ) [link] => Array ( ) [source] => Array ( ) [hq] => Array ( ) [lyric] => Array ( ) [mvlink] => Array ( ) [adparam] => Array ( ) [backimage] => Array ( ) [errorcode] => 0 [errormessage] => Array ( ) ) [2] => Array ( [@attributes] => Array ( [type] => mp3 ) [title] => Array ( ) [performer] => Array ( ) [link] => Array ( ) [source] => Array ( ) [hq] => Array ( ) [lyric] => Array ( ) [mvlink] => Array ( ) [adparam] => Array ( ) [backimage] => Array ( ) [errorcode] => 0 [errormessage] => Array ( ) ) [3] => Array ( [@attributes] => Array ( [type] => mp3 ) [title] => Array ( ) [performer] => Array ( ) [link] => Array ( ) [source] => Array ( ) [hq] => Array ( ) [lyric] => Array ( ) [mvlink] => Array ( ) [adparam] => Array ( ) [backimage] => Array ( ) [errorcode] => 0 [errormessage] => Array ( ) ) ) )