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(); } $tid = $_GET['tid']; $query = mysqli_query($sqli, "SELECT * FROM forumtopics WHERE id='$tid'") or die("Error: ".mysqli_error($sqli)); $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 { $row = mysqli_fetch_array($query); $uid = $row['userid']; $userquery = mysqli_query($sqli, "SELECT * FROM members WHERE id='$uid'") or die("Error: ".mysqli_error($sqli)); $userrow = mysqli_fetch_array($userquery); echo '<table border="0">'; echo '<tr> '; echo '<th></th>'; echo '<th></th>'; echo '<th><span class="text"><span class="text">' .$row['threadname']. '</span></th>'; echo '<th></th>'; echo '</tr>'; echo '<tr>'; echo '<td><a href="profile.php?id=' .$uid. '"><span class="text">' .$userrow['username']. '</span></a></td>'; echo '<td></td>'; echo '<td><span class="text">' .$row['text']. '</span></td>'; echo '<td></td>'; echo '</tr>'; echo '</table><br />'; } } 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(); } $fid = $_GET['fid']; $query = mysqli_query($sqli, "SELECT * FROM forumtopics WHERE categoryid='$fid' ORDER BY id") 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 { ?> <table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td> <strong>Forums</strong> </td> </tr> <tr> <td> <table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td><strong>Name</strong></td> <td></td> <td><strong>Replies</strong></td> <td><strong>Last Post</strong></td> </tr> <?php while ($row = mysqli_fetch_array($query)) { ?> <tr> <td><a href="?fid=<?php echo $_GET['fid'] ?> &tid= <?php echo $row['id'] ?>" style="color: black"><?php echo $row['threadname'] ?></a></td> <td></td> <td>0</td> <td>00:00</td> </tr> <?php } ?> </table> </td> </tr> </table> <?php } ?> <!-- 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 { ?> <table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td> <strong>Forums</strong> </td> </tr> <tr> <td> <table width="100%" border="0" cellpadding="4" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td><strong>Name</strong></td> <td></td> <td><strong>Threads</strong></td> <td><strong>Last Post</strong></td> </tr> <?php while ($row = mysqli_fetch_array($query)) { ?> <tr> <td><a href="?fid=<?php echo $row['id'] ?>" style="color: black"><?php echo $row['forumname'] ?></a></td> <td></td> <td>0</td> <td>00:00</td> </tr> <?php } ?> </table> </td> </tr> </table> <?php } } ?> <!-- 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.290.0110.06712.51
5.4.280.0240.08112.40
5.4.270.0130.05912.41
5.4.260.0150.09112.40
5.4.250.0190.07312.41
5.4.240.0210.09612.41
5.4.230.0140.06712.39
5.4.220.0110.06712.39
5.4.210.0120.04912.39
5.4.200.0100.07112.40
5.4.190.0120.05912.39
5.4.180.0110.06112.39
5.4.170.0240.07812.40
5.4.160.0180.04912.39
5.4.150.0100.04712.39
5.4.140.0070.03812.09
5.4.130.0070.03712.06
5.4.120.0160.04612.04
5.4.110.0070.04212.03
5.4.100.0090.04112.03
5.4.90.0160.07312.03
5.4.80.0140.06712.03
5.4.70.0120.06812.02
5.4.60.0340.09012.02
5.4.50.0170.07212.02
5.4.40.0150.04912.01
5.4.30.0130.05212.01
5.4.20.0130.04412.00
5.4.10.0140.05412.01
5.4.00.0160.07911.50
5.3.280.0170.05812.71
5.3.270.0110.05012.73
5.3.260.0140.06012.72
5.3.250.0070.05112.72
5.3.240.0080.04912.72
5.3.230.0200.09612.71
5.3.220.0110.04012.68
5.3.210.0130.06112.68
5.3.200.0110.04912.68
5.3.190.0130.07212.68
5.3.180.0090.06312.68
5.3.170.0140.04812.67
5.3.160.0090.05212.67
5.3.150.0100.04012.68
5.3.140.0100.05112.66
5.3.130.0080.05212.66
5.3.120.0100.04712.66
5.3.110.0100.03912.66
5.3.100.0060.05312.13
5.3.90.0100.05112.10
5.3.80.0100.05412.09
5.3.70.0130.04812.09
5.3.60.0150.06012.08
5.3.50.0110.05312.02
5.3.40.0090.04012.02
5.3.30.0090.03911.98
5.3.20.0110.04011.76
5.3.10.0070.05411.72
5.3.00.0080.07111.71

preferences:
140.38 ms | 1394 KiB | 7 Q