3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $collection_musiques = array(); $rang = 0; $musique = simplexml_load_file("https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml"); $M_list = $musique->getElementsByTagName("entry"); foreach ($M_list as $M){ $rang ++; $objet = new musique(); $objet->titre = array( "num" => $M->getElementsByTagName("id")->item(0)->getAttribute("im:id"), "nom" => $this->nettoieChaine($M->getElementsByTagName("name")->item(0)->nodeValue) ); $objet->auteur = array( "num" => $this->cutIdItunesArtist($M->getElementsByTagName("artist")->item(0)->getAttribute("href")), "nom" => $this->nettoieChaine($M->getElementsByTagName("artist")->item(0)->nodeValue) ); $objet->droit = $this->nettoieChaine($M->getElementsByTagName("rights")->item(0), true); $objet->lien = $M->getElementsByTagName("link")->item(0)->getAttribute("href"); $objet->cover = $M->getElementsByTagName("image")->item(2)->nodeValue; if($M->getElementsByTagName("category")->item(0) != null) $objet->style = $M->getElementsByTagName("category")->item(0)->getAttribute("term"); else $objet->style = ""; $objet->rang = $rang; if($M->getElementsByTagName("link")->item(1) != null) { $objet->extrait = $M->getElementsByTagName("link")->item(1)->getAttribute("href"); } $collection_musiques[$rang-1] = $objet; }
Output for 7.0.0 - 7.1.0
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/1ChjY on line 5 Warning: simplexml_load_file(https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/1ChjY on line 5 Warning: simplexml_load_file(): I/O warning : failed to load external entity "https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml" in /in/1ChjY on line 5 Fatal error: Uncaught Error: Call to a member function getElementsByTagName() on boolean in /in/1ChjY:7 Stack trace: #0 {main} thrown in /in/1ChjY on line 7
Process exited with code 255.
Output for 5.6.0 - 5.6.28
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/1ChjY on line 5 Warning: simplexml_load_file(https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/1ChjY on line 5 Warning: simplexml_load_file(): I/O warning : failed to load external entity "https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml" in /in/1ChjY on line 5 Fatal error: Call to a member function getElementsByTagName() on boolean in /in/1ChjY on line 7
Process exited with code 255.
Output for 5.4.15 - 5.5.38
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/1ChjY on line 5 Warning: simplexml_load_file(https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/1ChjY on line 5 Warning: simplexml_load_file(): I/O warning : failed to load external entity "https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml" in /in/1ChjY on line 5 Fatal error: Call to a member function getElementsByTagName() on a non-object in /in/1ChjY on line 7
Process exited with code 255.
Output for 5.3.0 - 5.4.14
Warning: simplexml_load_file(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/1ChjY on line 5 Warning: simplexml_load_file(): I/O warning : failed to load external entity "https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml" in /in/1ChjY on line 5 Fatal error: Call to a member function getElementsByTagName() on a non-object in /in/1ChjY on line 7
Process exited with code 255.
Output for 5.1.0 - 5.2.17
Notice: simplexml_load_file(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/1ChjY on line 5 Warning: simplexml_load_file(): I/O warning : failed to load external entity "https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml" in /in/1ChjY on line 5 Fatal error: Call to a member function getElementsByTagName() on a non-object in /in/1ChjY on line 7
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Notice: simplexml_load_file(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/1ChjY on line 5 Notice: simplexml_load_file(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/1ChjY on line 5 Warning: I/O warning : failed to load external entity "https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml" in /in/1ChjY on line 5 Fatal error: Call to a member function getElementsByTagName() on a non-object in /in/1ChjY on line 7
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ')' in /in/1ChjY on line 15
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ')' in /in/1ChjY on line 15
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/1ChjY on line 15
Process exited with code 255.