3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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 (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).
Note: hhvm uses a JIT which only kicks in after a few runs. Since we run scripts only once, hhvm always runs slower.

VersionSystem time (s)User time (s)Memory (MiB)
5.4.290.0060.05512.50
5.4.280.0040.05312.39
5.4.270.0100.04712.40
5.4.260.0060.04312.39
5.4.250.0060.04012.39
5.4.240.0070.03712.40
5.4.230.0080.03812.39
5.4.220.0060.04012.39
5.4.210.0050.03612.39
5.4.200.0090.03412.39
5.4.190.0060.03712.39
5.4.180.0030.03912.38
5.4.170.0090.03912.39
5.4.160.0070.04112.39
5.4.150.0060.04812.38
5.4.140.0080.04912.08
5.4.130.0090.03712.05
5.4.120.0060.03812.02
5.4.110.0070.03612.02
5.4.100.0070.04812.02
5.4.90.0050.05412.02
5.4.80.0110.05112.02
5.4.70.0060.05412.02
5.4.60.0070.05112.01
5.4.50.0090.06112.02
5.4.40.0070.05212.00
5.4.30.0050.05112.00
5.4.20.0090.05011.99
5.4.10.0090.05712.00
5.4.00.0070.04311.49
5.3.280.0070.05412.71
5.3.270.0060.05712.72
5.3.260.0060.04412.72
5.3.250.0050.03712.71
5.3.240.0050.03912.71
5.3.230.0150.04612.71
5.3.220.0100.05112.68
5.3.210.0110.05412.68
5.3.200.0090.04512.68
5.3.190.0060.04012.68
5.3.180.0060.03712.67
5.3.170.0030.03912.67
5.3.160.0080.03512.67
5.3.150.0100.03812.67
5.3.140.0050.05512.66
5.3.130.0060.05712.66
5.3.120.0120.04612.66
5.3.110.0070.04512.66
5.3.100.0080.05312.12
5.3.90.0030.05712.09
5.3.80.0080.05612.09
5.3.70.0040.04512.08
5.3.60.0050.05512.07
5.3.50.0150.06512.01
5.3.40.0060.04712.01
5.3.30.0050.04511.97
5.3.20.0130.04111.75
5.3.10.0080.03611.71
5.3.00.0130.03011.71