3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $collection_musiques = array(); $musique = new DOMDocument(); $rang = 0; if(!$musique->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 5.4.15 - 5.6.28, 7.0.0 - 7.1.0
Warning: DOMDocument::load(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/FS3CX on line 6 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/FS3CX on line 6 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/FS3CX on line 6
Output for hhvm-3.10.0 - 3.13.2
Warning: Failed to open https://itunes.apple.com/fr/rss/topsongs/limit=200/genre=15/explicit=true/xml (Could not resolve host: itunes.apple.com)
Output for 5.3.0 - 5.4.14
Warning: DOMDocument::load(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/FS3CX on line 6 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/FS3CX on line 6
Output for 5.1.0 - 5.2.17
Notice: DOMDocument::load(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/FS3CX on line 6 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/FS3CX on line 6
Output for 5.0.0 - 5.0.5
Notice: DOMDocument::load(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/FS3CX on line 6 Notice: DOMDocument::load(): Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? in /in/FS3CX on line 6 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/FS3CX on line 6
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ')' in /in/FS3CX on line 17
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/FS3CX on line 17
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `')'' in /in/FS3CX on line 17
Process exited with code 255.