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 git.master, git.master_jit
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 rfc.property-hooks
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>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
50.75 ms | 405 KiB | 8 Q