3v4l.org

run code in 300+ PHP versions simultaneously
<?php $request = 'http://api.openweathermap.org/data/2.5/group?id=4880731,5000598,5128581,5368361,4887398,5391811,4930956,1275339,1273294,1275004,1264527,524901,703448,2643743,1816670,292223&APPID=ea2cc999e9e272185de78f08e2e738fc'; $response = file_get_contents($request); $data=json_decode($response,true); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset = "UTF-8" /> <meta name="author" content="Chaitanya" /> <meta name="keywords" content="countries, country id" /> <link rel="stylesheet" type="text/css" href="style.css" /> <title>PHP Application</title> </head> <body> <div class = "main-wrap"> <h2>PHP Web Assignment Task</h2> <hr /><br /> <form action="index.php" method="post"> <pre>Name: <input type="text" name="name"/> Country: <input type="text" name="country"> <input type="submit" name="filter" value="Filter"></pre> <br><br> </form> Search Term:<br /> <pre>Name: <?php echo $_POST['name']; ?> Country: <?php echo $_POST['country']; ?> </pre> <br /> <table border="1" cellspacing="5" width="100%" style="text-align: center"> <tr> <th>ID</th> <th>Name</th> <th>Country</th> </tr> <?php $count = $data['cnt']; $country; if($_POST['filter']){ if($_POST['country']){ $country = $_POST['country']; for($i = 0; $i < $count; $i++){ if($data['list'][$i]['sys']['country'] == $country){ echo "<tr>"; echo "<td>".$data['list'][$i]['id']."</td>"; echo "<td>".$data['list'][$i]['name']."</td>"; echo "<td>".$data['list'][$i]['sys']['country']."</td>"; echo "</tr>"; } else continue; } } if ($_POST['name']) { $name = $_POST['name']; for($i = 0; $i < $count; $i++){ if($data['list'][$i]['name'] == $name){ echo "<tr>"; echo "<td>".$data['list'][$i]['id']."</td>"; echo "<td>".$data['list'][$i]['name']."</td>"; echo "<td>".$data['list'][$i]['sys']['country']."</td>"; echo "</tr>"; } else continue; } } } else{ for($i = 0; $i < $count; $i++){ echo "<tr>"; echo "<td>".$data['list'][$i]['id']."</td>"; echo "<td>".$data['list'][$i]['name']."</td>"; echo "<td>".$data['list'][$i]['sys']['country']."</td>"; echo "</tr>"; } } ?> </table> </div> </body> </html>
Output for 8.3.0 - 8.3.6
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for api.openweathermap.org failed: System error in /in/fKb5O on line 4 Warning: file_get_contents(http://api.openweathermap.org/data/2.5/group?id=4880731,5000598,5128581,5368361,4887398,5391811,4930956,1275339,1273294,1275004,1264527,524901,703448,2643743,1816670,292223&APPID=ea2cc999e9e272185de78f08e2e738fc): Failed to open stream: php_network_getaddresses: getaddrinfo for api.openweathermap.org failed: System error in /in/fKb5O on line 4 <!DOCTYPE html> <html lang="en"> <head> <meta charset = "UTF-8" /> <meta name="author" content="Chaitanya" /> <meta name="keywords" content="countries, country id" /> <link rel="stylesheet" type="text/css" href="style.css" /> <title>PHP Application</title> </head> <body> <div class = "main-wrap"> <h2>PHP Web Assignment Task</h2> <hr /><br /> <form action="index.php" method="post"> <pre>Name: <input type="text" name="name"/> Country: <input type="text" name="country"> <input type="submit" name="filter" value="Filter"></pre> <br><br> </form> Search Term:<br /> <pre>Name: Warning: Undefined array key "name" in /in/fKb5O on line 32 Country: Warning: Undefined array key "country" in /in/fKb5O on line 33 </pre> <br /> <table border="1" cellspacing="5" width="100%" style="text-align: center"> <tr> <th>ID</th> <th>Name</th> <th>Country</th> </tr> Warning: Trying to access array offset on null in /in/fKb5O on line 50 Warning: Undefined array key "filter" in /in/fKb5O on line 56 </table> </div> </body> </html>
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo for api.openweathermap.org failed: System error in /in/fKb5O on line 4 Warning: file_get_contents(http://api.openweathermap.org/data/2.5/group?id=4880731,5000598,5128581,5368361,4887398,5391811,4930956,1275339,1273294,1275004,1264527,524901,703448,2643743,1816670,292223&APPID=ea2cc999e9e272185de78f08e2e738fc): Failed to open stream: php_network_getaddresses: getaddrinfo for api.openweathermap.org failed: System error in /in/fKb5O on line 4 <!DOCTYPE html> <html lang="en"> <head> <meta charset = "UTF-8" /> <meta name="author" content="Chaitanya" /> <meta name="keywords" content="countries, country id" /> <link rel="stylesheet" type="text/css" href="style.css" /> <title>PHP Application</title> </head> <body> <div class = "main-wrap"> <h2>PHP Web Assignment Task</h2> <hr /><br /> <form action="index.php" method="post"> <pre>Name: <input type="text" name="name"/> Country: <input type="text" name="country"> <input type="submit" name="filter" value="Filter"></pre> <br><br> </form> Search Term:<br /> <pre>Name: Warning: Undefined array key "name" in /in/fKb5O on line 32 Country: Warning: Undefined array key "country" in /in/fKb5O on line 33 </pre> <br /> <table border="1" cellspacing="5" width="100%" style="text-align: center"> <tr> <th>ID</th> <th>Name</th> <th>Country</th> </tr> Warning: Trying to access array offset on value of type null in /in/fKb5O on line 50 Warning: Undefined array key "filter" in /in/fKb5O on line 56 </table> </div> </body> </html>
Output for 8.0.13 - 8.0.30
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/fKb5O on line 4 Warning: file_get_contents(http://api.openweathermap.org/data/2.5/group?id=4880731,5000598,5128581,5368361,4887398,5391811,4930956,1275339,1273294,1275004,1264527,524901,703448,2643743,1816670,292223&APPID=ea2cc999e9e272185de78f08e2e738fc): Failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/fKb5O on line 4 <!DOCTYPE html> <html lang="en"> <head> <meta charset = "UTF-8" /> <meta name="author" content="Chaitanya" /> <meta name="keywords" content="countries, country id" /> <link rel="stylesheet" type="text/css" href="style.css" /> <title>PHP Application</title> </head> <body> <div class = "main-wrap"> <h2>PHP Web Assignment Task</h2> <hr /><br /> <form action="index.php" method="post"> <pre>Name: <input type="text" name="name"/> Country: <input type="text" name="country"> <input type="submit" name="filter" value="Filter"></pre> <br><br> </form> Search Term:<br /> <pre>Name: Warning: Undefined array key "name" in /in/fKb5O on line 32 Country: Warning: Undefined array key "country" in /in/fKb5O on line 33 </pre> <br /> <table border="1" cellspacing="5" width="100%" style="text-align: center"> <tr> <th>ID</th> <th>Name</th> <th>Country</th> </tr> Warning: Trying to access array offset on value of type null in /in/fKb5O on line 50 Warning: Undefined array key "filter" in /in/fKb5O on line 56 </table> </div> </body> </html>
Output for 8.0.0 - 8.0.12
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/fKb5O on line 4 Warning: file_get_contents(http://api.openweathermap.org/data/2.5/group?id=4880731,5000598,5128581,5368361,4887398,5391811,4930956,1275339,1273294,1275004,1264527,524901,703448,2643743,1816670,292223&APPID=ea2cc999e9e272185de78f08e2e738fc): Failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/fKb5O on line 4 <!DOCTYPE html> <html lang="en"> <head> <meta charset = "UTF-8" /> <meta name="author" content="Chaitanya" /> <meta name="keywords" content="countries, country id" /> <link rel="stylesheet" type="text/css" href="style.css" /> <title>PHP Application</title> </head> <body> <div class = "main-wrap"> <h2>PHP Web Assignment Task</h2> <hr /><br /> <form action="index.php" method="post"> <pre>Name: <input type="text" name="name"/> Country: <input type="text" name="country"> <input type="submit" name="filter" value="Filter"></pre> <br><br> </form> Search Term:<br /> <pre>Name: Warning: Undefined array key "name" in /in/fKb5O on line 32 Country: Warning: Undefined array key "country" in /in/fKb5O on line 33 </pre> <br /> <table border="1" cellspacing="5" width="100%" style="text-align: center"> <tr> <th>ID</th> <th>Name</th> <th>Country</th> </tr> Warning: Trying to access array offset on value of type null in /in/fKb5O on line 50 Warning: Undefined array key "filter" in /in/fKb5O on line 56 </table> </div> </body> </html>
Output for 7.4.0, 7.4.26 - 7.4.33
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/fKb5O on line 4 Warning: file_get_contents(http://api.openweathermap.org/data/2.5/group?id=4880731,5000598,5128581,5368361,4887398,5391811,4930956,1275339,1273294,1275004,1264527,524901,703448,2643743,1816670,292223&APPID=ea2cc999e9e272185de78f08e2e738fc): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/fKb5O on line 4 <!DOCTYPE html> <html lang="en"> <head> <meta charset = "UTF-8" /> <meta name="author" content="Chaitanya" /> <meta name="keywords" content="countries, country id" /> <link rel="stylesheet" type="text/css" href="style.css" /> <title>PHP Application</title> </head> <body> <div class = "main-wrap"> <h2>PHP Web Assignment Task</h2> <hr /><br /> <form action="index.php" method="post"> <pre>Name: <input type="text" name="name"/> Country: <input type="text" name="country"> <input type="submit" name="filter" value="Filter"></pre> <br><br> </form> Search Term:<br /> <pre>Name: Notice: Undefined index: name in /in/fKb5O on line 32 Country: Notice: Undefined index: country in /in/fKb5O on line 33 </pre> <br /> <table border="1" cellspacing="5" width="100%" style="text-align: center"> <tr> <th>ID</th> <th>Name</th> <th>Country</th> </tr> Notice: Trying to access array offset on value of type null in /in/fKb5O on line 50 Notice: Undefined index: filter in /in/fKb5O on line 56 </table> </div> </body> </html>
Output for 7.4.3 - 7.4.25
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/fKb5O on line 4 Warning: file_get_contents(http://api.openweathermap.org/data/2.5/group?id=4880731,5000598,5128581,5368361,4887398,5391811,4930956,1275339,1273294,1275004,1264527,524901,703448,2643743,1816670,292223&APPID=ea2cc999e9e272185de78f08e2e738fc): failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/fKb5O on line 4 <!DOCTYPE html> <html lang="en"> <head> <meta charset = "UTF-8" /> <meta name="author" content="Chaitanya" /> <meta name="keywords" content="countries, country id" /> <link rel="stylesheet" type="text/css" href="style.css" /> <title>PHP Application</title> </head> <body> <div class = "main-wrap"> <h2>PHP Web Assignment Task</h2> <hr /><br /> <form action="index.php" method="post"> <pre>Name: <input type="text" name="name"/> Country: <input type="text" name="country"> <input type="submit" name="filter" value="Filter"></pre> <br><br> </form> Search Term:<br /> <pre>Name: Notice: Undefined index: name in /in/fKb5O on line 32 Country: Notice: Undefined index: country in /in/fKb5O on line 33 </pre> <br /> <table border="1" cellspacing="5" width="100%" style="text-align: center"> <tr> <th>ID</th> <th>Name</th> <th>Country</th> </tr> Notice: Trying to access array offset on value of type null in /in/fKb5O on line 50 Notice: Undefined index: filter in /in/fKb5O on line 56 </table> </div> </body> </html>
Output for 7.3.32 - 7.3.33
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/fKb5O on line 4 Warning: file_get_contents(http://api.openweathermap.org/data/2.5/group?id=4880731,5000598,5128581,5368361,4887398,5391811,4930956,1275339,1273294,1275004,1264527,524901,703448,2643743,1816670,292223&APPID=ea2cc999e9e272185de78f08e2e738fc): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/fKb5O on line 4 <!DOCTYPE html> <html lang="en"> <head> <meta charset = "UTF-8" /> <meta name="author" content="Chaitanya" /> <meta name="keywords" content="countries, country id" /> <link rel="stylesheet" type="text/css" href="style.css" /> <title>PHP Application</title> </head> <body> <div class = "main-wrap"> <h2>PHP Web Assignment Task</h2> <hr /><br /> <form action="index.php" method="post"> <pre>Name: <input type="text" name="name"/> Country: <input type="text" name="country"> <input type="submit" name="filter" value="Filter"></pre> <br><br> </form> Search Term:<br /> <pre>Name: Country: </pre> <br /> <table border="1" cellspacing="5" width="100%" style="text-align: center"> <tr> <th>ID</th> <th>Name</th> <th>Country</th> </tr> </table> </div> </body> </html>
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.31
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/fKb5O on line 4 Warning: file_get_contents(http://api.openweathermap.org/data/2.5/group?id=4880731,5000598,5128581,5368361,4887398,5391811,4930956,1275339,1273294,1275004,1264527,524901,703448,2643743,1816670,292223&APPID=ea2cc999e9e272185de78f08e2e738fc): failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /in/fKb5O on line 4 <!DOCTYPE html> <html lang="en"> <head> <meta charset = "UTF-8" /> <meta name="author" content="Chaitanya" /> <meta name="keywords" content="countries, country id" /> <link rel="stylesheet" type="text/css" href="style.css" /> <title>PHP Application</title> </head> <body> <div class = "main-wrap"> <h2>PHP Web Assignment Task</h2> <hr /><br /> <form action="index.php" method="post"> <pre>Name: <input type="text" name="name"/> Country: <input type="text" name="country"> <input type="submit" name="filter" value="Filter"></pre> <br><br> </form> Search Term:<br /> <pre>Name: Notice: Undefined index: name in /in/fKb5O on line 32 Country: Notice: Undefined index: country in /in/fKb5O on line 33 </pre> <br /> <table border="1" cellspacing="5" width="100%" style="text-align: center"> <tr> <th>ID</th> <th>Name</th> <th>Country</th> </tr> Notice: Undefined index: filter in /in/fKb5O on line 56 </table> </div> </body> </html>
Output for 7.0.20, 7.1.5 - 7.1.25, 7.2.0 - 7.2.13, 7.3.0 - 7.3.1
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: System error in /in/fKb5O on line 4 Warning: file_get_contents(http://api.openweathermap.org/data/2.5/group?id=4880731,5000598,5128581,5368361,4887398,5391811,4930956,1275339,1273294,1275004,1264527,524901,703448,2643743,1816670,292223&APPID=ea2cc999e9e272185de78f08e2e738fc): failed to open stream: php_network_getaddresses: getaddrinfo failed: System error in /in/fKb5O on line 4 <!DOCTYPE html> <html lang="en"> <head> <meta charset = "UTF-8" /> <meta name="author" content="Chaitanya" /> <meta name="keywords" content="countries, country id" /> <link rel="stylesheet" type="text/css" href="style.css" /> <title>PHP Application</title> </head> <body> <div class = "main-wrap"> <h2>PHP Web Assignment Task</h2> <hr /><br /> <form action="index.php" method="post"> <pre>Name: <input type="text" name="name"/> Country: <input type="text" name="country"> <input type="submit" name="filter" value="Filter"></pre> <br><br> </form> Search Term:<br /> <pre>Name: Notice: Undefined index: name in /in/fKb5O on line 32 Country: Notice: Undefined index: country in /in/fKb5O on line 33 </pre> <br /> <table border="1" cellspacing="5" width="100%" style="text-align: center"> <tr> <th>ID</th> <th>Name</th> <th>Country</th> </tr> Notice: Undefined index: filter in /in/fKb5O on line 56 </table> </div> </body> </html>
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.10, 7.1.0
Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/fKb5O on line 4 Warning: file_get_contents(http://api.openweathermap.org/data/2.5/group?id=4880731,5000598,5128581,5368361,4887398,5391811,4930956,1275339,1273294,1275004,1264527,524901,703448,2643743,1816670,292223&APPID=ea2cc999e9e272185de78f08e2e738fc): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known in /in/fKb5O on line 4 <!DOCTYPE html> <html lang="en"> <head> <meta charset = "UTF-8" /> <meta name="author" content="Chaitanya" /> <meta name="keywords" content="countries, country id" /> <link rel="stylesheet" type="text/css" href="style.css" /> <title>PHP Application</title> </head> <body> <div class = "main-wrap"> <h2>PHP Web Assignment Task</h2> <hr /><br /> <form action="index.php" method="post"> <pre>Name: <input type="text" name="name"/> Country: <input type="text" name="country"> <input type="submit" name="filter" value="Filter"></pre> <br><br> </form> Search Term:<br /> <pre>Name: Notice: Undefined index: name in /in/fKb5O on line 32 Country: Notice: Undefined index: country in /in/fKb5O on line 33 </pre> <br /> <table border="1" cellspacing="5" width="100%" style="text-align: center"> <tr> <th>ID</th> <th>Name</th> <th>Country</th> </tr> Notice: Undefined index: filter in /in/fKb5O on line 56 </table> </div> </body> </html>

preferences:
195.03 ms | 406 KiB | 239 Q