3v4l.org

run code in 300+ PHP versions simultaneously
<?php $username = $_POST['username']; $pass = $_POST['Password']; $mysqli = new mysqli("localhost", "438613", "website", "438613"); if ($mysqli->connect_errno) { echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error; } else{ $username = $mysqli->real_escape_string($username); $pass = $mysqli->real_escape_string($pass); if($row=$mysqli->query("SELECT password FROM accounts WHERE username='$username'")){ if($row->num_rows == 0){ echo "No user with this email!"; header( "refresh:3;url=index.php" ); } else{ $result = $row->fetch_assoc(); $db_pass = $result["password"]; if (password_verify($pass, $db_pass)) { echo "The password is correct!"; session_start(); unset($_SESSION['user']); $_SESSION['user'] = $username; if (isset($_POST['remember'])) { $year = time() + 31536000; setcookie("user", $username, $year);; } header("Location:main.php"); exit(); } else{ echo "Incorrect password!"; header( "refresh:3;url=index.php" ); } } } else{ echo "Select error: (" . $mysqli->errno . ") " . $mysqli->error; } } ?>

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.4.00.0090.00914.65
7.3.120.0060.00914.82
7.3.110.0070.00914.96
7.3.100.0060.00614.70
7.3.90.0080.00814.65
7.3.80.0030.01115.01
7.3.70.0060.00714.78
7.3.60.0050.00914.71
7.3.50.0050.00714.75
7.3.40.0050.01014.65
7.3.30.0050.01014.75
7.3.20.0080.00716.49
7.3.10.0040.00816.49
7.3.00.0030.01216.61
7.2.250.0060.01115.15
7.2.240.0050.01415.18
7.2.230.0050.01314.91
7.2.220.0080.00614.99
7.2.210.0080.00514.88
7.2.200.0060.00515.02
7.2.190.0030.01415.09
7.2.180.0040.00714.94
7.2.170.0070.00814.87
7.2.60.0030.01016.85
7.2.00.0080.00619.42
7.1.330.0080.00615.77
7.1.320.0100.00215.70
7.1.310.0070.00715.50
7.1.300.0050.00815.63
7.1.290.0060.00715.68
7.1.280.0090.00415.53
7.1.270.0080.00715.58
7.1.260.0050.00815.77
7.1.200.0000.01015.71
7.1.100.0090.00318.31
7.1.70.0040.00417.11
7.1.60.0090.01519.70
7.1.50.0060.01816.85
7.1.00.0070.07322.54
7.0.200.0060.00316.73
7.0.140.0070.07021.91
7.0.80.0470.04320.07
7.0.70.0570.07320.03
7.0.60.0300.05720.03
7.0.50.0570.08320.25
7.0.40.0100.08019.92
7.0.30.0070.06020.10
7.0.20.0070.09020.00
7.0.10.0130.08019.95
7.0.00.0000.09020.12
5.6.280.0000.07721.13
5.6.230.0030.09020.66
5.6.220.0000.07320.71
5.6.210.0130.06720.45
5.6.200.0170.07721.09
5.6.190.0200.07720.94
5.6.180.0030.09321.09
5.6.170.0030.08721.06
5.6.160.0100.04721.03
5.6.150.0130.07321.04
5.6.140.0100.06021.17
5.6.130.0130.05721.08
5.6.120.0200.07321.02
5.6.110.0030.06321.13
5.6.100.0030.08020.99
5.6.90.0100.06320.91
5.6.80.0130.06720.34
5.6.70.0170.06320.32
5.6.60.0170.07320.31
5.6.50.0100.05720.56
5.6.40.0070.07720.36
5.6.30.0070.07720.30
5.6.20.0130.06720.43
5.6.10.0000.04720.46
5.6.00.0070.06720.39
5.5.370.0170.06720.37
5.5.360.0100.06720.45
5.5.350.0130.08020.43
5.5.340.0000.05720.87
5.5.330.0100.07720.65
5.5.320.0100.07720.87
5.5.310.0130.04720.73
5.5.300.0030.06720.89
5.5.290.0130.07720.90
5.5.280.0070.06020.79
5.5.270.0070.07720.92
5.5.260.0070.08020.86
5.5.250.0100.08020.58
5.5.240.0030.08720.16
5.5.230.0130.07320.16
5.5.220.0030.08320.26
5.5.210.0100.07320.22
5.5.200.0070.05720.25
5.5.190.0070.08020.24
5.5.180.0070.05720.21
5.5.160.0100.04720.24
5.5.150.0070.05020.24
5.5.140.0100.06020.24
5.5.130.0070.07320.15
5.5.120.0000.07320.19
5.5.110.0030.08020.28
5.5.100.0070.07320.09
5.5.90.0300.06020.07
5.5.80.0030.08020.07
5.5.70.0100.06320.04
5.5.60.0070.07320.16
5.5.50.0170.06720.09
5.5.40.0100.08020.14
5.5.30.0100.04020.00
5.5.20.0130.07320.11
5.5.10.0100.04320.03
5.5.00.0030.04320.05
5.4.450.0070.05319.27
5.4.440.0130.06719.41
5.4.430.0100.07719.27
5.4.420.0100.04319.52
5.4.410.0070.06019.25
5.4.400.0170.05718.81
5.4.390.0170.06719.14
5.4.380.0100.05319.05
5.4.370.0070.08019.06
5.4.360.0070.08019.03
5.4.350.0070.04718.79
5.4.340.0070.08018.90
5.4.320.0000.08019.05
5.4.310.0100.06719.06
5.4.300.0030.08019.17
5.4.290.0130.07319.23
5.4.280.0130.07319.08
5.4.270.0000.06719.10
5.4.260.0070.07719.23
5.4.250.0070.07318.89
5.4.240.0100.07319.06
5.4.230.0130.06719.12
5.4.220.0030.04719.05
5.4.210.0070.06019.07
5.4.200.0100.06718.89
5.4.190.0070.05019.06
5.4.180.0000.04018.82
5.4.170.0030.04318.79
5.4.160.0070.05319.12
5.4.150.0070.03319.12
5.4.140.0000.04016.33
5.4.130.0000.04016.29
5.4.120.0000.03716.36
5.4.110.0000.04016.21
5.4.100.0070.03016.48
5.4.90.0000.03716.20
5.4.80.0070.03016.33
5.4.70.0000.05016.43
5.4.60.0000.03316.18
5.4.50.0070.02716.20
5.4.40.0070.04716.46
5.4.30.0000.04016.27
5.4.20.0030.04316.35
5.4.10.0030.03716.35
5.4.00.0100.06015.68
5.3.290.0030.08714.66
5.3.280.0000.07314.60
5.3.270.0000.05314.47
5.3.260.0030.04314.45
5.3.250.0100.03314.61
5.3.240.0070.03314.57
5.3.230.0030.03714.61
5.3.220.0030.03714.56
5.3.210.0000.04314.52
5.3.200.0030.05314.41
5.3.190.0000.07714.57
5.3.180.0030.04314.43
5.3.170.0030.04014.43
5.3.160.0070.05714.57
5.3.150.0070.03314.56
5.3.140.0070.05714.56
5.3.130.0030.04014.55
5.3.120.0030.03314.54
5.3.110.0000.04014.38
5.3.100.0030.04313.96
5.3.90.0030.03713.89
5.3.80.0070.04014.01
5.3.70.0070.03313.99
5.3.60.0030.03013.99
5.3.50.0130.04013.94
5.3.40.0030.03313.89
5.3.30.0030.05013.93
5.3.20.0030.03313.70
5.3.10.0030.05013.63
5.3.00.0000.03713.65
5.2.170.0030.03711.14
5.2.160.0030.02710.95
5.2.150.0130.02711.10
5.2.140.0000.03311.15
5.2.130.0000.02710.93
5.2.120.0000.06310.98
5.2.110.0030.03010.98
5.2.100.0000.02711.09
5.2.90.0000.03311.14
5.2.80.0030.03011.11
5.2.70.0000.04711.17
5.2.60.0030.02710.85
5.2.50.0030.06011.08
5.2.40.0030.06311.03
5.2.30.0070.03310.93
5.2.20.0000.04010.93
5.2.10.0030.03010.93
5.2.00.0030.02710.73
5.1.60.0100.01710.04
5.1.50.0000.02310.07
5.1.40.0000.0339.99
5.1.30.0000.03010.41
5.1.20.0030.04010.44
5.1.10.0070.01710.07
5.1.00.0030.02310.13
5.0.50.0070.0138.43
5.0.40.0000.0308.47
5.0.30.0100.0608.29
5.0.20.0000.0208.31
5.0.10.0070.0408.30
5.0.00.0030.0638.23
4.4.90.0000.0177.85
4.4.80.0000.0307.85
4.4.70.0000.0337.85
4.4.60.0000.0177.85
4.4.50.0000.0177.85
4.4.40.0000.0277.85
4.4.30.0030.0137.85
4.4.20.0000.0207.85
4.4.10.0000.0177.85
4.4.00.0030.0537.85
4.3.110.0070.0277.85
4.3.100.0130.0177.85
4.3.90.0030.0307.85
4.3.80.0030.0507.85
4.3.70.0030.0207.85
4.3.60.0000.0207.85
4.3.50.0000.0377.85
4.3.40.0000.0507.85
4.3.30.0030.0337.85
4.3.20.0000.0277.85
4.3.10.0030.0307.85
4.3.00.0000.0307.85

preferences:
36.52 ms | 400 KiB | 5 Q