3v4l.org

run code in 300+ PHP versions simultaneously
<?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.3.0 - 5.3.29, 5.4.0 - 5.4.14, 7.1.20 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
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 7.0.20, 7.1.5 - 7.1.10
Warning: DOMDocument::load(): php_network_getaddresses: getaddrinfo failed: System error 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: System error 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.4.15 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.14, 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 5.1.0 - 5.1.6, 5.2.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.3.11, 4.4.0 - 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.

preferences:
264.04 ms | 401 KiB | 372 Q