3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $collection_musiques = array(); $rang = 0; if(!$musique = DOMDocument::load("https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml")) return false; $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.0.3, 7.0.5 - 7.1.0
Deprecated: Non-static method DOMDocument::load() should not be called statically in /in/Jr9cY on line 5 Warning: DOMDocument::load(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/Jr9cY on line 5 Warning: DOMDocument::load(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/Jr9cY on line 5 Warning: DOMDocument::load(): I/O warning : failed to load external entity "https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml" in /in/Jr9cY on line 5
Output for 7.0.4
Deprecated: Non-static method DOMDocument::load() should not be called statically in /in/Jr9cY on line 5 Warning: DOMDocument::load(): php_network_getaddresses: getaddrinfo failed: System error in /in/Jr9cY on line 5 Warning: DOMDocument::load(https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/Jr9cY on line 5 Warning: DOMDocument::load(): I/O warning : failed to load external entity "https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml" in /in/Jr9cY on line 5
Output for 5.4.34 - 5.4.38, 5.5.24 - 5.5.32, 5.5.34 - 5.6.17, 5.6.20 - 5.6.28
Strict Standards: Non-static method DOMDocument::load() should not be called statically in /in/Jr9cY on line 5 Warning: DOMDocument::load(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/Jr9cY on line 5 Warning: DOMDocument::load(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/Jr9cY on line 5 Warning: DOMDocument::load(): I/O warning : failed to load external entity "https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml" in /in/Jr9cY on line 5
Output for 5.4.39 - 5.4.45, 5.5.33, 5.6.18 - 5.6.19
Strict Standards: Non-static method DOMDocument::load() should not be called statically in /in/Jr9cY on line 5 Warning: DOMDocument::load(): php_network_getaddresses: getaddrinfo failed: System error in /in/Jr9cY on line 5 Warning: DOMDocument::load(https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/Jr9cY on line 5 Warning: DOMDocument::load(): I/O warning : failed to load external entity "https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml" in /in/Jr9cY on line 5
Output for 5.3.0 - 5.4.32
Strict Standards: Non-static method DOMDocument::load() should not be called statically in /in/Jr9cY on line 5 Warning: DOMDocument::load(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/Jr9cY on line 5 Warning: DOMDocument::load(): I/O warning : failed to load external entity "https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml" in /in/Jr9cY on line 5
Output for 5.1.0 - 5.2.17
Strict Standards: Non-static method DOMDocument::load() should not be called statically in /in/Jr9cY on line 5 Notice: DOMDocument::load(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/Jr9cY on line 5 Warning: DOMDocument::load(): I/O warning : failed to load external entity "https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml" in /in/Jr9cY on line 5
Output for 5.0.0 - 5.0.5
Strict Standards: Non-static method DOMDocument::load() should not be called statically in /in/Jr9cY on line 5 Notice: DOMDocument::load(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/Jr9cY on line 5 Notice: DOMDocument::load(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/Jr9cY 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/Jr9cY on line 5
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ')' in /in/Jr9cY on line 16
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/Jr9cY on line 16
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/Jr9cY on line 16
Process exited with code 255.