3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $img_client="http://www.freeradionetwork.eu/NetworkPictures/pc_client.gif"; $img_gateway="http://www.freeradionetwork.eu/NetworkPictures/gatewayAn.gif"; //a seguinte linha funciona no pc, mas não online em servidores sem a função activada $xml = simplexml_load_file('http://www.freeradionetwork.eu/NetworkStatus/web_cast.xml'); $i=-1; echo '<ul id="servidores">'."\n"; foreach ($xml as $xmlinfo): $nome=$xmlinfo['name']; if ($i!=-1) { //porque a primeira linha é:"<SystemStatus DataUpdate="True"/>" e não um server if ($nome=="alverca.no-ip.org - Port: 10023" || $nome=="america-portugal.no-ip.org - Port: 10018" || $nome=="atalaia-frn.no-ip.org - Port: 10025" || $nome=="eqso-gdm2.dyndns.org - Port: 10024" || $nome=="firealpha.dyndns.org - Port: 10024" || $nome=="frn-algarve.no-ip.org - Port: 10024" || $nome=="frn-portugal.no-ip.org - Port: 10024" || $nome=="frn-portugal2.no-ip.org - Port: 10024" || $nome=="navegantespt.no-ip.org - Port: 10022" || $nome=="master.freeradionetwork.pt - Port: 10024" || $nome=="master2.freeradionetwork.pt - Port: 10024" || $nome=="portugal-pmr.no-ip.org - Port: 10020" || $nome=="tiaanicaloule.mine.nu - Port: 10024" || $nome=="pmrpampi.no-ip.org - Port: 10024" || $nome=="mhzgaia.no-ip.org - Port: 10024" || $nome=="frn-portugal.no-ip.org - Port: 10000") { echo '<li><div class="nome"><b>'.$nome.'</b></div></li>'."\n"; //apresentar os servidores echo '<ul id="canais">'."\n"; $j=0; foreach ($xml->server[$i]->net as $canal): $canal_nome=$canal['name']; echo '<li><div class="canal_nome"><b>'.$canal_nome.'</b></div></li>'."\n"; //apresentar os canais echo '<ul id="users">'."\n"; foreach ($xml->server[$i]->net[$j] as $client): $client_nome=$client['name']; $gateway=$client['gateway']; if ($gateway == "True") { //apresentar os clients echo '<li><div class="client_nome"><img src="'.$img_gateway.'" height="15px"/>'.$client_nome.'</div></li>'."\n"; } else { echo '<li><div class="client_nome"><img src="'.$img_client.'" height="15px"/>'.$client_nome.'</div></li>'."\n"; } endforeach; echo "</ul>"."\n"; endforeach; $j++; echo "</ul>"."\n"; } } $i++; endforeach; echo "</ul>"."\n";
Output for 5.2.6 - 5.6.28, 7.0.0 - 7.1.0
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/2jmtI on line 6 Warning: simplexml_load_file(http://www.freeradionetwork.eu/NetworkStatus/web_cast.xml): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/2jmtI on line 6 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://www.freeradionetwork.eu/NetworkStatus/web_cast.xml" in /in/2jmtI on line 6 <ul id="servidores"> Warning: Invalid argument supplied for foreach() in /in/2jmtI on line 11 </ul>
Output for hhvm-3.10.0 - 3.12.0
Warning: Failed to open http://www.freeradionetwork.eu/NetworkStatus/web_cast.xml (Could not resolve host: www.freeradionetwork.eu) in /in/2jmtI on line 6 <ul id="servidores"> Warning: Invalid argument supplied for foreach() in /in/2jmtI on line 56 </ul>
Output for 5.1.0 - 5.2.5
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/2jmtI on line 6 Warning: simplexml_load_file(http://www.freeradionetwork.eu/NetworkStatus/web_cast.xml): failed to open stream: Connection refused in /in/2jmtI on line 6 Warning: simplexml_load_file(): I/O warning : failed to load external entity "http://www.freeradionetwork.eu/NetworkStatus/web_cast.xml" in /in/2jmtI on line 6 <ul id="servidores"> Warning: Invalid argument supplied for foreach() in /in/2jmtI on line 11 </ul>
Output for 5.0.3 - 5.0.5
Warning: simplexml_load_file(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/2jmtI on line 6 Warning: simplexml_load_file(http://www.freeradionetwork.eu/NetworkStatus/web_cast.xml): failed to open stream: Connection refused in /in/2jmtI on line 6 Warning: connection refusedI/O warning : failed to load external entity "http://www.freeradionetwork.eu/NetworkStatus/web_cast.xml" in /in/2jmtI on line 6 <ul id="servidores"> Warning: Invalid argument supplied for foreach() in /in/2jmtI on line 11 </ul>
Output for 5.0.1 - 5.0.2
Warning: simplexml_load_file(): php_network_getaddresses: gethostbyname failed in /in/2jmtI on line 6 Warning: simplexml_load_file(http://www.freeradionetwork.eu/NetworkStatus/web_cast.xml): failed to open stream: Success in /in/2jmtI on line 6 Warning: connection refusedI/O warning : failed to load external entity "http://www.freeradionetwork.eu/NetworkStatus/web_cast.xml" in /in/2jmtI on line 6 <ul id="servidores"> Warning: Invalid argument supplied for foreach() in /in/2jmtI on line 11 </ul>
Output for 5.0.0
Warning: simplexml_load_file(): php_network_getaddresses: gethostbyname failed in /in/2jmtI on line 6 Warning: simplexml_load_file(http://www.freeradionetwork.eu/NetworkStatus/web_cast.xml): failed to open stream: Bad file descriptor in /in/2jmtI on line 6 Warning: connection refusedI/O warning : failed to load external entity "http://www.freeradionetwork.eu/NetworkStatus/web_cast.xml" in /in/2jmtI on line 6 <ul id="servidores"> Warning: Invalid argument supplied for foreach() in /in/2jmtI on line 11 </ul>
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: simplexml_load_file() in /in/2jmtI on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: simplexml_load_file() in /in/2jmtI on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: simplexml_load_file() in /in/2jmtI on line 6