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 - Profile</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 /> <?php if (isset($_GET['action'])) { if ($_GET['action'] == 'edit') { if (isset($_GET['id'])) { // Connect to MySQLi $sqli = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME) or die(mysqli_errno()); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $id = $_GET['id']; $query = mysqli_query($sqli, "SELECT * FROM members WHERE id='$id'") or die("Error: ".mysqli_error($sqli)); $checkuser = mysqli_num_rows($query); // Check if user exists if($checkuser != 1) { // Username not exist echo '<span class="text">Username does not exist in the database!</span><br />'; } else { while ($row = mysqli_fetch_array($query)) { ?> <table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form method="post" action=""> <td> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td colspan="3"><strong>Profile Edit</strong></td> </tr> <tr> <td colspan="3"><?php if(isset($message)) { echo $message; } ?></td> </tr> <tr> <td width="78">Username</td> <td width="6">:</td> <td width="294"><input name="username" type="text" id="username" value="<?php echo $row['username'] ?>" readonly="readonly"></td> </tr> <tr> <td width="78">E-mail</td> <td width="6">:</td> <td width="294"><input name="email" type="text" id="email" value="<?php echo $row['email'] ?>" readonly="readonly"></td> </tr> <tr> <td width="78">New Password</td> <td width="6">:</td> <td width="294"><input name="password" type="text" id="password" readonly="readonly"></td> </tr> <tr> <td width="78">New Password Repeat</td> <td width="6">:</td> <td width="294"><input name="passwordrepeat" type="text" id="passwordrepeat" readonly="readonly"></td> </tr> <tr> <td colspan="3"><strong>Member Edit</strong></td> </tr> <tr> <td colspan="3"><strong>Current Password</strong></td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td><input type="submit" name="save" value="Save"></td> </tr> </table> </td> </form> </tr> </table> <?php } } } else { echo '<span class="text">No ID!</span><br />'; } } } else { if (isset($_GET['id'])) { // Connect to MySQLi $sqli = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME) or die(mysqli_errno()); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $id = $_GET['id']; $query = mysqli_query($sqli, "SELECT * FROM members WHERE id='$id'") or die("Error: ".mysqli_error($sqli)); $checkuser = mysqli_num_rows($query); // Check if user exists if($checkuser != 1) { // Username not exist echo '<span class="text">Username does not exist in the database!</span><br />'; } else { while ($row = mysqli_fetch_array($query)) { echo '<span class="text">Username: '; echo $row['username']; echo '</span> <br/>'; echo '<span class="text">Level: '; echo $row['level']; echo '</span> <br/>'; } } } elseif (isset($_SESSION['username']) && $_SESSION['id'])) { // Connect to MySQLi $sqli = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME) or die(mysqli_errno()); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $id = $_SESSION['id']; $query = mysqli_query($sqli, "SELECT * FROM members WHERE id='$id'") or die("Error: ".mysqli_error($sqli)); $checkuser = mysqli_num_rows($query); // Check if user exists if($checkuser != 1) { // Username not exist echo '<span class="text">Username does not exist in the database!</span><br />'; } else { while ($row = mysqli_fetch_array($query)) { echo '<span class="text">Username: '; echo $row['username']; echo '</span> <br/>'; echo '<span class="text">Level: '; echo $row['level']; echo '</span> <br/>'; } echo '<a href="?action=edit">EDIT PROFILE</a><br/>'; } } else { echo '<span class="text">No ID!</span><br />'; } } $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.0120.03812.53
5.4.280.0130.06412.41
5.4.270.0090.06112.41
5.4.260.0090.06612.41
5.4.250.0120.06312.41
5.4.240.0130.05412.41
5.4.230.0140.05012.40
5.4.220.0100.05212.40
5.4.210.0060.05612.40
5.4.200.0150.06312.41
5.4.190.0090.03812.40
5.4.180.0070.04812.39
5.4.170.0140.05012.40
5.4.160.0130.05212.39
5.4.150.0090.04812.39
5.4.140.0080.04112.08
5.4.130.0110.03812.07
5.4.120.0120.06212.03
5.4.110.0110.05612.03
5.4.100.0190.05712.03
5.4.90.0170.05512.03
5.4.80.0130.06912.02
5.4.70.0100.06112.02
5.4.60.0080.05312.02
5.4.50.0120.04812.02
5.4.40.0130.05512.01
5.4.30.0190.04512.00
5.4.20.0090.05112.00
5.4.10.0110.04512.00
5.4.00.0110.04711.49
5.3.280.0440.06412.71
5.3.270.0110.07212.72
5.3.260.0100.06212.72
5.3.250.0090.05812.72
5.3.240.0160.06312.72
5.3.230.0100.04812.71
5.3.220.0180.05312.68
5.3.210.0100.06212.68
5.3.200.0110.04512.68
5.3.190.0160.06112.68
5.3.180.0110.05612.67
5.3.170.0050.04612.67
5.3.160.0070.04112.67
5.3.150.0100.05312.68
5.3.140.0080.06412.66
5.3.130.0080.04812.66
5.3.120.0080.04212.66
5.3.110.0080.04012.66
5.3.100.0110.04512.12
5.3.90.0080.04212.09
5.3.80.0140.07912.08
5.3.70.0160.04912.08
5.3.60.0080.04112.07
5.3.50.0120.04212.02
5.3.40.0080.04212.02
5.3.30.0070.03911.97
5.3.20.0060.03911.76
5.3.10.0110.03911.72
5.3.00.0090.05311.71
5.2.170.0050.0489.21
5.2.160.0090.0499.22
5.2.150.0110.0339.22
5.2.140.0060.0339.21
5.2.130.0090.0299.17
5.2.120.0140.0359.18
5.2.110.0060.0369.18
5.2.100.0050.0339.18
5.2.90.0080.0299.18
5.2.80.0080.0319.17
5.2.70.0060.0359.17
5.2.60.0080.0359.13
5.2.50.0100.0379.10
5.2.40.0060.0329.07
5.2.30.0090.0289.05
5.2.20.0100.0309.04
5.2.10.0060.0418.96
5.2.00.0050.0468.82
5.1.60.0090.0258.11
5.1.50.0080.0358.11
5.1.40.0050.0378.09
5.1.30.0050.0568.43
5.1.20.0100.0358.46
5.1.10.0090.0268.18
5.1.00.0050.0328.18
5.0.50.0070.0266.66
5.0.40.0090.0256.52
5.0.30.0080.0606.33
5.0.20.0070.0316.30
5.0.10.0160.0236.29
5.0.00.0120.0476.28
4.4.90.0150.0434.78
4.4.80.0050.0314.76
4.4.70.0070.0224.75
4.4.60.0070.0194.76
4.4.50.0130.0514.77
4.4.40.0050.0294.71
4.4.30.0140.0524.76
4.4.20.0030.0224.84
4.4.10.0030.0154.85
4.4.00.0050.0224.76
4.3.110.0040.0184.67
4.3.100.0030.0164.67
4.3.90.0030.0154.63
4.3.80.0010.0274.59
4.3.70.0030.0184.63
4.3.60.0040.0164.63
4.3.50.0050.0144.63
4.3.40.0050.0234.54
4.3.30.0020.0173.35
4.3.20.0030.0183.33
4.3.10.0030.0163.26
4.3.00.0170.0177.98

preferences:
143.44 ms | 1394 KiB | 7 Q