3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.3.0 - 8.3.6
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: Uncaught Error: Call to a member function getElementsByTagName() on false in /in/1ChjY:7 Stack trace: #0 {main} thrown in /in/1ChjY on line 7
Process exited with code 255.
Output for 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
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: Uncaught Error: Call to a member function getElementsByTagName() on bool in /in/1ChjY:7 Stack trace: #0 {main} thrown in /in/1ChjY on line 7
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33
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: 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.40
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 boolean in /in/1ChjY on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38
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.1.6, 5.2.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.3.11, 4.4.0 - 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.

preferences:
245.62 ms | 401 KiB | 459 Q