3v4l.org

run code in 300+ PHP versions simultaneously
<?php $connection = mysql_connect('localhost', 'jones.trenton', 'lolPassword'); mysql_select_db('jones.trenton'); $query = "SELECT * FROM computerparts"; $result = mysql_query($query); echo "<table border='1'> <tr> <th>Part</th> <th>In stock</th> <th>Sold</th> <th>Shipped</th> <th>Returned</th> </tr>"; while($row = mysql_fetch_array($result)){ echo "<tr><td>" . $row['Part'] . "</td><td>" . $row['In stock'] . "</td><td>" . $row['Sold'] . "</td><td>" . $row['Shipped'] . "</td><td>" . $row['Returned'] . "</td></tr>"; } echo "</table>"; mysql_close(); ?> <doctype html> <html> <head> <title>Add</title> </head> <body> <form action="Jones-add.php" method="post"> Part Name: <input type="text" name="name"> # In Stock: <input type="text" name="stock"> # Sold: <input type="text" name="sold"> # Shipped: <input type="text" name="shipped"> # Returned: <input type="text" name="returned"> <input type="submit"> </form> <?php $con = mysql_connect('localhost', 'jones.trenton', 'lolPassword',"jones.trenton"); $name = $_POST['name']; $stock = $_POST['stock']; $sold = $_POST['sold']; $shipped = $_POST['shipped']; $returned = $_POST['returned']; INSERT INTO `jones.trenton`.`computerparts` (`Part`, `In stock`, `Sold`, `Shipped`, `Returned`) VALUES ($name, $stock, $sold, $shipped, $returned); echo "1 record added"; mysql_close(); ?> </body> </html>

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.270.0270.07319.22
5.4.260.0170.07318.99
5.4.250.0330.06018.86
5.4.240.0230.04319.30
5.4.230.0300.04319.00
5.4.220.0170.07018.97
5.4.210.0300.07319.30
5.4.200.0270.07319.11
5.4.190.0270.05719.07
5.4.180.0230.05719.20
5.4.170.0200.05319.22
5.4.160.0200.04719.09
5.4.150.0270.07018.85
5.4.140.0200.06316.35
5.4.130.0270.06716.48
5.4.120.0170.04016.51
5.4.110.0300.06316.54
5.4.100.0300.06316.36
5.4.90.0300.04016.54
5.4.80.0200.04016.52
5.4.70.0230.06316.54
5.4.60.0270.06716.49
5.4.50.0270.07016.33
5.4.40.0230.06316.23
5.4.30.0300.05016.53
5.4.20.0170.04316.42
5.4.10.0270.07016.16
5.4.00.0200.06715.95
5.3.280.0230.04714.57
5.3.270.0230.07714.50
5.3.260.0330.06314.48
5.3.250.0230.07714.47
5.3.240.0230.06314.71
5.3.230.0300.04314.57
5.3.220.0230.04314.68
5.3.210.0370.05714.54
5.3.200.0200.06714.43
5.3.190.0170.04314.54
5.3.180.0170.03714.46
5.3.170.0100.05314.68
5.3.160.0170.07314.41
5.3.150.0200.07014.49
5.3.140.0200.07014.41
5.3.130.0130.04714.44
5.3.120.0270.07014.41
5.3.110.0270.03014.66
5.3.100.0130.05714.07
5.3.90.0200.03313.97
5.3.80.0200.06314.13
5.3.70.0170.03713.89
5.3.60.0200.07313.85
5.3.50.0230.03713.95
5.3.40.0230.04714.01
5.3.30.0230.06314.02
5.3.20.0200.06713.62
5.3.10.0130.04013.55
5.3.00.0130.04013.62
5.2.170.0130.02712.69
5.2.160.0100.03312.69
5.2.150.0130.03012.69
5.2.140.0200.02012.69
5.2.130.0170.02712.69
5.2.120.0200.03012.69
5.2.110.0100.03312.69
5.2.100.0200.02012.69
5.2.90.0200.02712.69
5.2.80.0130.03312.69
5.2.70.0170.03012.69
5.2.60.0130.02712.69
5.2.50.0130.02712.69
5.2.40.0170.03012.69
5.2.30.0070.03312.69
5.2.20.0100.02712.69
5.2.10.0100.03712.69
5.2.00.0070.03012.69
5.1.60.0100.02312.69
5.1.50.0070.02712.69
5.1.40.0100.02312.69
5.1.30.0100.02712.69
5.1.20.0070.02712.69
5.1.10.0100.03312.69
5.1.00.0130.02012.69
5.0.50.0030.02312.69
5.0.40.0030.02012.69
5.0.30.0030.03012.69
5.0.20.0100.01712.69
5.0.10.0070.01712.69
5.0.00.0070.03012.69
4.4.90.0070.01312.69
4.4.80.0030.01712.69
4.4.70.0070.01312.69
4.4.60.0070.01312.69
4.4.50.0030.01712.69
4.4.40.0030.02312.69
4.4.30.0070.01312.69
4.4.20.0030.01712.69
4.4.10.0070.01312.69
4.4.00.0030.02312.69
4.3.110.0030.01712.69
4.3.100.0070.01712.69
4.3.90.0070.01312.69
4.3.80.0030.02712.69
4.3.70.0070.01312.69
4.3.60.0000.02012.69
4.3.50.0030.01712.69
4.3.40.0030.02712.69
4.3.30.0000.01712.69
4.3.20.0000.01712.69
4.3.10.0000.01712.69
4.3.00.0000.01712.69

preferences:
140.74 ms | 1394 KiB | 7 Q