3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('display_errors', 'On'); error_reporting(E_ALL); $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $start = $time; define("DB_HOST","mysql117.loopia.se"); define("DB_USER","normal@i103189"); define("DB_PASS","KungMicke87"); define("DB_NAME","indiehjaerta_com"); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=UTF-8" /> <title>indiehjaerta.com - Forum</title> <link href="style_test.css" rel="stylesheet" type="text/css" /> </head> <body> <a href="login.php">Login<a/> - <a href="admin.php">Admin<a/> - <a href="members.php">Members<a/> - <a href="register.php">Register<a/> - <a href="blog.php">Blog<a/> - <a href="news.php">News<a/> - <a href="event.php">Event<a/> - <a href="forum.php">Forum<a/> - <a href="profile.php">Profile<a/> - <a href="logout.php">Logout<a/> <br /> <br /> <!-- New Post Start --> <!-- New Post End --> <!-- List Forum Category Threads - Start --> <?php if (isset($_GET['fid'])) { if (isset($_GET['tid'])) { // Connect to MySQLi $sqli = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME) or die("Error: ".mysqli_error($sqli)); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $query = mysqli_query($sqli, "SELECT * FROM forumtopics ORDER BY id") or die("Error: ".mysqli_error($sqli)); //Don't order by ID! $checkthreadexists = mysqli_num_rows($query); // Check if we have ny threads in this category if($checkthreadexists == 0) { // No threads echo '<span class="text">No such topic ID exists!</span><br />'; } else { } } else { // Connect to MySQLi $sqli = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME) or die("Error: ".mysqli_error($sqli)); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $query = mysqli_query($sqli, "SELECT * FROM forumtopics ORDER BY id WHERE categoryid='$_GET['fid']'") or die("Error: ".mysqli_error($sqli)); //Don't order by ID! $checknumthreads = mysqli_num_rows($query); // Check if we have ny threads in this category if($checknumthreads == 0) { // No threads echo '<span class="text">No forums threads found in the database!</span><br />'; } else { echo '<table border="0"> <tr> <th><span class="text">Name</span></th> <th></th> <th><span class="text">Replies</span></th> <th></th> </tr>'; while ($row = mysqli_fetch_array($query)) { echo '<tr>'; echo '<td><a href="?fid=' .$_GET['fid']. '&tid=' .$row['id']. '"><span class="text">' .$row['threadname']. '</span></a></td>'; echo '<td></td>'; echo '<td><span class="text">0</span></td>'; echo '<td></td>'; echo '</tr>'; } echo '</table><br />'; } } ?> <!-- List Forum Category Threads - End --> <!-- List Forum Categories - Start --> <?php } else { // Connect to MySQLi $sqli = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME) or die("Error: ".mysqli_error($sqli)); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $query = mysqli_query($sqli, "SELECT * FROM forumcat ORDER BY id") or die("Error: ".mysqli_error($sqli)); $checknumforums = mysqli_num_rows($query); // Check if we have any forum categories if($checknumforums == 0) { // No forums echo '<span class="text">No forums found in the database!</span><br />'; } else { echo '<table border="0"> <tr> <th><span class="text">Name</span></th> <th></th> <th><span class="text">Threads</span></th> <th></th> </tr>'; while ($row = mysqli_fetch_array($query)) { echo '<tr>'; echo '<td><a href="?fid=' .$row['id']. '"><span class="text">' .$row['forumname']. '</span></a></td>'; echo '<td></td>'; echo '<td><span class="text">0</span></td>'; echo '<td></td>'; echo '</tr>'; } echo '</table><br />'; } } ?> <!-- List Forum Categories - End --> <?php $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $finish = $time; $total_time = round(($finish - $start), 4); echo '<span class="text">Page generated in '.$total_time.' seconds.</span><br />'; ?> </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.280.0040.04212.39
5.4.270.0100.04212.38
5.4.260.0110.03712.39
5.4.250.0070.04112.39
5.4.240.0060.04212.38
5.4.230.0140.04912.38
5.4.220.0100.04812.38
5.4.210.0050.04112.38
5.4.200.0080.03912.38
5.4.190.0070.04412.37
5.4.180.0070.04212.37
5.4.170.0100.03812.38
5.4.160.0090.03912.38
5.4.150.0100.04812.38
5.4.140.0170.07412.07
5.4.130.0170.09012.04
5.4.120.0080.04812.01
5.4.110.0130.10612.00
5.4.100.0170.04812.00
5.4.90.0070.12212.01
5.4.80.0120.05612.01
5.4.70.0190.07712.00
5.4.60.0120.05312.00
5.4.50.0080.05112.00
5.4.40.0040.03911.99
5.4.30.0080.03711.98
5.4.20.0090.03711.98
5.4.10.0060.04011.99
5.4.00.0080.03911.48
5.3.280.0080.04212.71
5.3.270.0080.04312.72
5.3.260.0090.04112.72
5.3.250.0060.04212.72
5.3.240.0080.04012.72
5.3.230.0070.04212.71
5.3.220.0100.04512.68
5.3.210.0120.04812.68
5.3.200.0160.08612.68
5.3.190.0180.06912.68
5.3.180.0060.04612.67
5.3.170.0130.03712.66
5.3.160.0110.04812.67
5.3.150.0130.03612.68
5.3.140.0100.03812.66
5.3.130.0110.04612.66
5.3.120.0080.04512.66
5.3.110.0230.05112.65
5.3.100.0100.03812.12
5.3.90.0070.04012.09
5.3.80.0080.03912.07
5.3.70.0100.05912.08
5.3.60.0070.04212.06
5.3.50.0470.09012.00
5.3.40.0170.06812.00
5.3.30.0170.06911.95
5.3.20.0140.05811.72
5.3.10.0250.07811.68
5.3.00.0170.07211.67

preferences:
143.68 ms | 1394 KiB | 7 Q