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 (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 /> <?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)
7.3.10.0060.00716.55
7.3.00.0050.01216.43
7.2.130.0060.00816.54
7.2.120.0130.00816.78
7.2.110.0040.00916.69
7.2.100.0030.01016.79
7.2.90.0030.00816.96
7.2.80.0070.00716.78
7.2.70.0070.00916.60
7.2.60.0050.00816.90
7.2.50.0100.00716.49
7.2.40.0050.01016.70
7.2.30.0070.00716.66
7.2.20.0040.00916.64
7.2.10.0070.01016.52
7.2.00.0090.00617.66
7.1.250.0110.00415.39
7.1.70.0040.00417.22
7.1.60.0070.01719.46
7.1.50.0060.01616.96
7.1.00.0030.07722.45
7.0.200.0170.00016.78
7.0.140.0030.07722.12
7.0.110.0430.08719.93
7.0.100.0130.06720.12
7.0.90.0200.08020.06
7.0.80.0500.07019.96
7.0.70.0230.08019.91
7.0.60.0170.07720.04
7.0.50.0070.04320.24
7.0.40.0070.05019.98
7.0.30.0100.04719.98
7.0.20.0170.08020.25
7.0.10.0130.06320.04
7.0.00.0130.06320.27
5.6.280.0100.06720.79
5.6.250.0130.04320.66
5.6.240.0130.10020.66
5.6.230.0130.07720.63
5.6.220.0130.04720.63
5.6.210.0070.05320.65
5.6.200.0100.07720.99
5.6.190.0070.05320.95
5.6.180.0030.05321.22
5.6.170.0070.05021.11
5.6.160.0130.05321.11
5.6.150.0170.07321.17
5.6.140.0070.07721.03
5.6.130.0200.08020.98
5.6.120.0070.08020.99
5.6.110.0070.08321.00
5.6.100.0200.08021.14
5.6.90.0170.06721.07
5.6.80.0030.04020.48
5.6.70.0100.03720.66
5.6.60.0100.06320.50
5.6.50.0070.05720.43
5.6.40.0030.04020.48
5.6.30.0030.04020.52
5.6.20.0030.05720.64
5.6.10.0000.04320.29
5.6.00.0070.05320.63
5.5.380.0070.09320.51
5.5.370.0200.07020.34
5.5.360.0070.07720.54
5.5.350.0130.07720.38
5.5.340.0030.06321.06
5.5.330.0170.07320.98
5.5.320.0100.04720.82
5.5.310.0100.07320.98
5.5.300.0130.08720.82
5.5.290.0100.05020.75
5.5.280.0100.08020.83
5.5.270.0100.04720.76
5.5.260.0100.07720.97
5.5.250.0000.09020.80
5.5.240.0070.07720.24
5.5.230.0030.07720.20
5.5.220.0130.07320.34
5.5.210.0070.05320.32
5.5.200.0000.04320.27
5.5.190.0070.03720.35
5.5.180.0030.04020.39
5.5.160.0070.03320.41
5.5.150.0130.06020.32
5.5.140.0070.03320.41
5.5.130.0030.04320.23
5.5.120.0130.02720.26
5.5.110.0000.04320.27
5.5.100.0030.04020.30
5.5.90.0070.05320.05
5.5.80.0070.03320.10
5.5.70.0070.03720.05
5.5.60.0070.07720.00
5.5.50.0130.02720.23
5.5.40.0070.04320.21
5.5.30.0100.03320.07
5.5.20.0070.05020.20
5.5.10.0030.04020.04
5.5.00.0130.03020.02
5.4.450.0070.09019.39
5.4.440.0100.05719.48
5.4.430.0100.05719.61
5.4.420.0130.07319.59
5.4.410.0000.08019.27
5.4.400.0000.05018.92
5.4.390.0070.07019.05
5.4.380.0100.07019.10
5.4.370.0030.05719.07
5.4.360.0100.05318.99
5.4.350.0000.04019.25
5.4.340.0000.04019.07
5.4.320.0000.04019.21
5.4.310.0030.07718.99
5.4.300.0030.06019.05
5.4.290.0070.04019.18
5.4.280.0030.04019.27
5.4.270.0100.03318.95
5.4.260.0030.03719.09
5.4.250.0000.08019.04
5.4.240.0030.08019.08
5.4.230.0070.03319.17
5.4.220.0030.06319.17
5.4.210.0100.03018.99
5.4.200.0030.04019.06
5.4.190.0030.03719.10
5.4.180.0030.04019.11
5.4.170.0100.03318.94
5.4.160.0000.04019.04
5.4.150.0070.03318.93
5.4.140.0100.06716.42
5.4.130.0000.03316.27
5.4.120.0100.02716.44
5.4.110.0070.03316.46
5.4.100.0000.03716.53
5.4.90.0000.03716.51
5.4.80.0100.05016.46
5.4.70.0030.03316.29
5.4.60.0000.04016.42
5.4.50.0030.03316.23
5.4.40.0030.03716.43
5.4.30.0000.03716.46
5.4.20.0100.03316.43
5.4.10.0070.04316.41
5.4.00.0030.03315.66
5.3.290.0030.03714.56
5.3.280.0000.07714.72
5.3.270.0100.03714.64
5.3.260.0100.06714.60
5.3.250.0000.03714.45
5.3.240.0100.03314.46
5.3.230.0030.07314.50
5.3.220.0000.04714.44
5.3.210.0030.04014.67
5.3.200.0070.03314.69
5.3.190.0070.05014.68
5.3.180.0070.03014.59
5.3.170.0100.03014.43
5.3.160.0030.03714.41
5.3.150.0070.03314.68
5.3.140.0100.03014.43
5.3.130.0030.05714.43
5.3.120.0130.03014.45
5.3.110.0030.05014.54
5.3.100.0070.06013.94
5.3.90.0070.03014.16
5.3.80.0030.03313.93
5.3.70.0030.08014.12
5.3.60.0030.07313.93
5.3.50.0070.08013.80
5.3.40.0100.07014.06
5.3.30.0130.06313.88
5.3.20.0030.04313.57
5.3.10.0030.07713.70
5.3.00.0100.06713.58
5.2.170.0100.05711.30
5.2.160.0030.06011.53
5.2.150.0000.06311.26
5.2.140.0100.05311.21
5.2.130.0030.05711.20
5.2.120.0070.05311.27
5.2.110.0070.06311.21
5.2.100.0100.05711.14
5.2.90.0030.06311.11
5.2.80.0100.05711.17
5.2.70.0100.05011.34
5.2.60.0030.03711.14
5.2.50.0130.05311.13
5.2.40.0030.06311.28
5.2.30.0000.06311.21
5.2.20.0030.06011.04
5.2.10.0030.05711.04
5.2.00.0030.06311.01
5.1.60.0070.05010.27
5.1.50.0000.05010.27
5.1.40.0030.05310.27
5.1.30.0130.02710.52
5.1.20.0030.06010.43
5.1.10.0070.05310.27
5.1.00.0070.03310.27
5.0.50.0070.04310.27
5.0.40.0070.04010.27
5.0.30.0000.06710.27
5.0.20.0070.03710.27
5.0.10.0000.04310.27
5.0.00.0000.05010.27
4.4.90.0000.03010.27
4.4.80.0030.02710.27
4.4.70.0070.03010.27
4.4.60.0000.03710.27
4.4.50.0000.02310.27
4.4.40.0000.05310.27
4.4.30.0000.02710.27
4.4.20.0070.03010.27
4.4.10.0070.03310.27
4.4.00.0000.04710.27
4.3.110.0030.03710.27
4.3.100.0000.03010.27
4.3.90.0030.03310.27
4.3.80.0000.05310.27
4.3.70.0000.03310.27
4.3.60.0100.02710.27
4.3.50.0070.03010.27
4.3.40.0070.04710.27
4.3.30.0000.03710.27
4.3.20.0000.03710.27
4.3.10.0030.03310.27
4.3.00.0000.03310.27

preferences:
31.76 ms | 401 KiB | 5 Q