3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); require "config.php"; //Check to see if the user is logged in. if(isset($_SESSION['username'])){ header("location: members.php"); } //Check to see if the user click the button if(isset($_POST['submit'])) { $user=$_POST['user']; $pass=$_POST['pass']; //Prevent MySQL Injections $user  = stripslashes($user); $pass  = stripslashes($pass); $user = mysqli_real_escape_string($con, $user); $pass = mysqli_real_escape_string($con, $pass); //Check to see if the user left any space empty! if($user == "" || $pass == "") { echo "Please fill in all the information!"; } //Check to see if the username AND password MATCHES the username AND password in the DB else { $query = mysqli_query($con,"SELECT * FROM members WHERE username = '$user' and password = '$pass'") or die("Can not query DB."); $count = mysqli_num_rows($query);   if ($count == 1) { $_SESSION['username']=$user; //Create a session for the user! header ("location: members.php"); }     else{   echo "Username and Password DO NOT MATCH! TRY AGAIN!";   } } } ?> <html> <table width="300" align="center" cellpadding="0" cellspacing="1" border="1px solid black"> <tr> <form name="register" method="POST" action="login.php"> <td> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td colspan="3"><strong><center>Login </center></strong></td> </tr> <tr> <td width="78">Username</td> <td width="6">:</td> <td width="294"><input name="user" type="text" id="user"></td> </tr> <tr> <td>Password</td> <td>:</td> <td><input name="pass" type="password" id="pass"></td> </tr> <tr> <td></td> <td></td> <td><input type="submit" name="submit" value="Login"></td> </tr> </table> </td> </form> </tr> </table> </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.200.0080.04012.39
5.4.190.0150.04512.36
5.4.180.0170.04312.36
5.4.170.0150.04412.38
5.4.160.0170.04412.36
5.4.150.0120.04712.36
5.4.140.0230.05512.06
5.4.130.0180.04212.03
5.4.120.0150.04212.00
5.4.110.0160.04012.00
5.4.100.0180.04112.00
5.4.90.0180.04212.00
5.4.80.0160.04212.00
5.4.70.0150.04212.00
5.4.60.0160.04112.00
5.4.50.0170.06212.00
5.4.40.0160.04211.98
5.4.30.0160.04311.98
5.4.20.0230.05611.97
5.4.10.0140.04411.98
5.4.00.0160.04211.47
5.3.270.0220.06112.72
5.3.260.0200.05212.72
5.3.250.0170.04512.72
5.3.240.0210.06012.72
5.3.230.0160.04612.70
5.3.220.0170.04312.68
5.3.210.0150.04712.68
5.3.200.0230.05112.68
5.3.190.0160.04512.68
5.3.180.0180.04212.68
5.3.170.0240.06612.67
5.3.160.0170.04612.67
5.3.150.0200.04112.67
5.3.140.0170.04712.66
5.3.130.0170.04812.66
5.3.120.0180.04612.66
5.3.110.0160.04612.66
5.3.100.0130.04912.12
5.3.90.0160.04512.08
5.3.80.0150.04612.08
5.3.70.0150.04712.08
5.3.60.0190.04312.06
5.3.50.0170.05312.00
5.3.40.0240.05812.00
5.3.30.0170.04211.94
5.3.20.0160.04311.71
5.3.10.0180.03911.68
5.3.00.0170.04111.66

preferences:
138.74 ms | 1394 KiB | 7 Q