3v4l.org

run code in 300+ PHP versions simultaneously
<?php $url = "https://www.youtube.com/feeds/videos.xml?user=XLLease"; $rss = simplexml_load_file($url); // XML parser //getNamespaces $ns=$rss->getNamespaces(true); foreach($rss->entry as $entry) { //set children of namespaces $yt=$entry->children($ns['yt']); $media=$entry->children($ns['media']); foreach ($media as $key => $value) { $url = $value->thumbnail->attributes()->url->__toString(); var_dump($url); } }
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/XGX83 on line 3 Warning: simplexml_load_file(): I/O warning : failed to load external entity "https://www.youtube.com/feeds/videos.xml?user=XLLease" in /in/XGX83 on line 3 Fatal error: Uncaught Error: Call to a member function getNamespaces() on false in /in/XGX83:6 Stack trace: #0 {main} thrown in /in/XGX83 on line 6
Process exited with code 255.
Output for 7.3.16 - 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/XGX83 on line 3 Warning: simplexml_load_file(): I/O warning : failed to load external entity "https://www.youtube.com/feeds/videos.xml?user=XLLease" in /in/XGX83 on line 3 Fatal error: Uncaught Error: Call to a member function getNamespaces() on bool in /in/XGX83:6 Stack trace: #0 {main} thrown in /in/XGX83 on line 6
Process exited with code 255.
Output for 7.1.20, 7.2.6 - 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/XGX83 on line 3 Warning: simplexml_load_file(): I/O warning : failed to load external entity "https://www.youtube.com/feeds/videos.xml?user=XLLease" in /in/XGX83 on line 3 Fatal error: Uncaught Error: Call to a member function getNamespaces() on boolean in /in/XGX83:6 Stack trace: #0 {main} thrown in /in/XGX83 on line 6
Process exited with code 255.
Output for 7.0.20, 7.1.5 - 7.1.10, 7.2.0
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: System error in /in/XGX83 on line 3 Warning: simplexml_load_file(https://www.youtube.com/feeds/videos.xml?user=XLLease): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/XGX83 on line 3 Warning: simplexml_load_file(): I/O warning : failed to load external entity "https://www.youtube.com/feeds/videos.xml?user=XLLease" in /in/XGX83 on line 3 Fatal error: Uncaught Error: Call to a member function getNamespaces() on boolean in /in/XGX83:6 Stack trace: #0 {main} thrown in /in/XGX83 on line 6
Process exited with code 255.
Output for 7.0.0 - 7.0.10, 7.1.0
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/XGX83 on line 3 Warning: simplexml_load_file(https://www.youtube.com/feeds/videos.xml?user=XLLease): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/XGX83 on line 3 Warning: simplexml_load_file(): I/O warning : failed to load external entity "https://www.youtube.com/feeds/videos.xml?user=XLLease" in /in/XGX83 on line 3 Fatal error: Uncaught Error: Call to a member function getNamespaces() on boolean in /in/XGX83:6 Stack trace: #0 {main} thrown in /in/XGX83 on line 6
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/XGX83 on line 3 Warning: simplexml_load_file(https://www.youtube.com/feeds/videos.xml?user=XLLease): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/XGX83 on line 3 Warning: simplexml_load_file(): I/O warning : failed to load external entity "https://www.youtube.com/feeds/videos.xml?user=XLLease" in /in/XGX83 on line 3 Fatal error: Call to a member function getNamespaces() on boolean in /in/XGX83 on line 6
Process exited with code 255.
Output for 5.5.0 - 5.5.38
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/XGX83 on line 3 Warning: simplexml_load_file(https://www.youtube.com/feeds/videos.xml?user=XLLease): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/XGX83 on line 3 Warning: simplexml_load_file(): I/O warning : failed to load external entity "https://www.youtube.com/feeds/videos.xml?user=XLLease" in /in/XGX83 on line 3 Fatal error: Call to a member function getNamespaces() on a non-object in /in/XGX83 on line 6
Process exited with code 255.

preferences:
197.11 ms | 402 KiB | 226 Q