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"); if (true) /*if (isset($_POST['add'])) */ { //forumreplies if (isset($_POST['forumid']) && (!empty($_POST['forumid']))) { // 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(); } $saveThread = TRUE; $emptyStory = FALSE; $emptyText = FALSE; $subject = mysqli_real_escape_string($sqli, $_POST['subject']); $text = mysqli_real_escape_string($sqli, $_POST['text']); $fid = mysqli_real_escape_string($sqli, $_POST['forumid']); $query = mysqli_query($sqli,"SELECT * FROM forumcat WHERE id='$fid'") or die("Error: ".mysqli_error($sqli)); $results = mysqli_num_rows($query); if ($results == 0) { $error = "No such CategoryID."; } else { $timestamp = date('Y-m-d H:i:s'); $userid = $_SESSION['id']; if (empty($subject)) { $emptySubject = TRUE; $saveThread = FALSE; } elseif (empty($text)) { $emptyText = TRUE; $saveThread = FALSE; } if ($saveThread == TRUE) { $addquery = mysqli_query($sqli,"INSERT INTO forumtopics (`threadname`, `text`, `categoryid`, `userid`, `timestamp`) VALUES ('$subject', '$text', '$fid', '$userid', '$timestamp')"); $tid = mysqli_insert_id($addquery); header("location:forummessage.php?added=thread&fid=$fid&tid=$tid"); } } } else { echo "No ForumID set."; } } ?> <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="logout.php">Logout<a/> <br /> <hr /> <br /> <? elseif (true) /*elseif /* (isset($_GET['added']) && ($_GET['added'] == 'thread'))*/ { ?> <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="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td colspan="3"><strong>Thread Created</strong></td> </tr> <tr> <td colspan="3"><a href="forum.php?fid=$_GET['fid']&tid=$_GET['tid']">Link to thread.</a></td> </tr> </table> </td> </tr> </table> <?php } ?> <?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.04712.50
5.4.280.0110.05112.40
5.4.270.0080.05612.40
5.4.260.0090.05612.39
5.4.250.0080.05012.40
5.4.240.0090.05212.39
5.4.230.0090.04212.39
5.4.220.0070.03812.39
5.4.210.0060.03812.39
5.4.200.0130.10512.39
5.4.190.0040.04012.38
5.4.180.0080.04112.39
5.4.170.0110.03812.39
5.4.160.0040.04812.39
5.4.150.0120.05712.39
5.4.140.0090.06212.08
5.4.130.0090.03812.06
5.4.120.0100.08312.02
5.4.110.0110.04212.02
5.4.100.0080.04012.02
5.4.90.0090.03812.02
5.4.80.0090.03612.02
5.4.70.0100.04212.01
5.4.60.0110.07012.01
5.4.50.0100.03912.02
5.4.40.0090.05712.00
5.4.30.0170.03612.00
5.4.20.0180.05711.99
5.4.10.0120.04712.00
5.4.00.0160.08611.50
5.3.280.0080.05412.71
5.3.270.0070.04712.73
5.3.260.0070.05512.72
5.3.250.0120.04212.72
5.3.240.0110.04212.72
5.3.230.0090.05512.71
5.3.220.0070.09312.68
5.3.210.0190.07512.68
5.3.200.0120.07312.68
5.3.190.0090.05612.68
5.3.180.0100.05112.68
5.3.170.0050.04112.67
5.3.160.0060.04312.67
5.3.150.0130.04612.67
5.3.140.0080.04712.66
5.3.130.0100.07212.66
5.3.120.0070.06912.66
5.3.110.0100.06112.66
5.3.100.0070.04912.12
5.3.90.0080.04112.09
5.3.80.0060.05212.08
5.3.70.0070.05612.08
5.3.60.0130.04512.07
5.3.50.0110.03812.01
5.3.40.0090.04512.01
5.3.30.0120.04611.97
5.3.20.0040.04611.75
5.3.10.0060.04811.72
5.3.00.0080.03811.71

preferences:
137.32 ms | 1394 KiB | 7 Q