3v4l.org

run code in 300+ PHP versions simultaneously
<?php include "inc/conn.php"; include "inc/connmysql.php"; session_start(); if (isset($_SESSION['Username'])) { header("location:login_success.php"); } if (isset($_POST['Username'])) { ob_start(); $myUsername = $_POST['Username']; $myPassword = $_POST['password']; $sqlname = "SELECT * FROM dbo.Users WHERE Username='$myUsername' and Password='$myPassword'"; $params = array(); $options = array('Scrollable' => SQLSRV_CURSOR_KEYSET); $stmt = sqlsrv_query( $conn, $sqlname, $params, $options); $row_count = sqlsrv_num_rows( $stmt ); if($row_count==1){ $_SESSION['Username']= $myUsername; $_SESSION['Password']= $myPassword; $kb= $_SESSION['Username']; if (!$mysqli->query("CREATE TABLE IF NOT EXISTS user_log (id INT AUTO_INCREMENT PRIMARY KEY,user VARCHAR(15),state VARCHAR (7),ts TIMESTAMP)") || !$mysqli->query("INSERT INTO user_log (user, state) VALUES ('$kb', 'Login')")) { echo "Table creation failed: (" . $mysqli->errno . ") " . $mysqli->error; } header("location:login_success.php"); } else { echo "Wrong Username or Password"; if (!$mysqli->query("CREATE TABLE IF NOT EXISTS user_log (id INT AUTO_INCREMENT PRIMARY KEY,user VARCHAR(15),state VARCHAR (7),ts TIMESTAMP)") || !$mysqli->query("INSERT INTO user_log (user, state) VALUES ('user', 'LogFail')")) { echo "Table creation failed: (" . $mysqli->errno . ") " . $mysqli->error; } } ob_end_flush(); } else { header("location:sql.php"); } ?>

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)
8.3.60.0090.00618.43
8.3.50.0140.00622.05
8.3.40.0140.00718.92
8.3.30.0070.00718.71
8.3.20.0080.00018.69
8.3.10.0080.00021.10
8.3.00.0090.00023.56
8.2.180.0150.00616.75
8.2.170.0140.00022.96
8.2.160.0130.00620.39
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00419.66
8.2.110.0030.00620.18
8.2.100.0090.00317.72
8.2.90.0050.00319.27
8.2.80.0000.00817.97
8.2.70.0050.00317.63
8.2.60.0030.00617.93
8.2.50.0050.00318.07
8.2.40.0030.00518.22
8.2.30.0080.00019.61
8.2.20.0030.00517.84
8.2.10.0050.00317.61
8.2.00.0050.00317.75
8.1.280.0030.01425.92
8.1.270.0000.00823.99
8.1.260.0050.00326.35
8.1.250.0060.00328.09
8.1.240.0060.00322.52
8.1.230.0090.00320.91
8.1.220.0000.00818.77
8.1.210.0040.00418.82
8.1.200.0030.00717.47
8.1.190.0000.00817.53
8.1.180.0000.00818.10
8.1.170.0060.00318.77
8.1.160.0000.00818.93
8.1.150.0040.00418.70
8.1.140.0000.00717.50
8.1.130.0030.00317.86
8.1.120.0040.00417.49
8.1.110.0030.00517.33
8.1.100.0040.00417.35
8.1.90.0030.00517.46
8.1.80.0000.00817.34
8.1.70.0030.00317.43
8.1.60.0040.00417.48
8.1.50.0040.00417.56
8.1.40.0000.00717.57
8.1.30.0030.00617.66
8.1.20.0000.00917.66
8.1.10.0000.00817.54
8.1.00.0080.00017.46
8.0.300.0000.00820.16
8.0.290.0040.00417.43
8.0.280.0040.00418.48
8.0.270.0000.00717.29
8.0.260.0000.00717.12
8.0.250.0050.00317.18
8.0.240.0040.00417.14
8.0.230.0000.00717.18
8.0.220.0000.00816.99
8.0.210.0000.00717.07
8.0.200.0030.00717.03
8.0.190.0030.00517.09
8.0.180.0000.00717.00
8.0.170.0000.00816.99
8.0.160.0040.00417.14
8.0.150.0000.00816.93
8.0.140.0070.00017.09
8.0.130.0000.00613.52
8.0.120.0030.00616.93
8.0.110.0000.00717.12
8.0.100.0000.00816.96
8.0.90.0040.00417.00
8.0.80.0110.00417.04
8.0.70.0050.00217.11
8.0.60.0000.00717.14
8.0.50.0000.00717.08
8.0.30.0100.01017.14
8.0.20.0110.00717.40
8.0.10.0030.00517.00
8.0.00.0110.00816.81
7.4.330.0030.00314.66
7.4.320.0060.00016.67
7.4.300.0070.00016.46
7.4.290.0030.00316.51
7.4.280.0070.00016.49
7.4.270.0040.00416.52
7.4.260.0000.00513.33
7.4.250.0040.00416.65
7.4.240.0030.00616.67
7.4.230.0000.00716.73
7.4.220.0170.01016.74
7.4.210.0070.00816.73
7.4.200.0080.00016.75
7.4.190.0030.00316.47
7.4.160.0040.01216.45
7.4.150.0120.00617.40
7.4.140.0160.00617.86
7.4.130.0100.00816.60
7.4.120.0090.01116.60
7.4.110.0110.00616.61
7.4.100.0090.01316.55
7.4.90.0040.01216.57
7.4.80.0080.01119.39
7.4.70.0120.00616.46
7.4.60.0090.00916.47
7.4.50.0090.00016.58
7.4.40.0120.00322.52
7.4.30.0090.00916.67
7.4.00.0050.01114.77
7.3.330.0030.00313.20
7.3.320.0050.00013.26
7.3.310.0030.00316.44
7.3.300.0070.00016.26
7.3.290.0040.01116.39
7.3.280.0100.00716.38
7.3.270.0060.01017.40
7.3.260.0110.01018.24
7.3.250.0050.01316.50
7.3.240.0160.00716.33
7.3.230.0110.00616.39
7.3.210.0100.01316.36
7.3.200.0090.01219.39
7.3.190.0120.00616.39
7.3.180.0130.00316.38
7.3.170.0030.01416.39
7.3.160.0160.00016.44
7.3.120.0020.01414.81
7.3.110.0080.01014.87
7.3.100.0060.01114.79
7.3.90.0050.00914.73
7.3.80.0060.01014.78
7.3.70.0060.00514.92
7.3.60.0080.00714.91
7.3.50.0050.01014.80
7.3.40.0080.00514.84
7.3.30.0110.00214.66
7.3.20.0080.00716.60
7.3.10.0050.01016.66
7.3.00.0050.00716.66
7.2.330.0060.01316.46
7.2.320.0000.01716.75
7.2.310.0000.02416.69
7.2.300.0120.00416.57
7.2.290.0090.01216.46
7.2.250.0060.01215.13
7.2.240.0110.00614.97
7.2.230.0050.01014.90
7.2.220.0100.00315.10
7.2.210.0040.01014.81
7.2.200.0110.00315.05
7.2.190.0060.00815.15
7.2.180.0100.00614.82
7.2.170.0040.01114.95
7.2.60.0030.00917.05
7.1.330.0030.01015.67
7.1.320.0050.00915.69
7.1.310.0100.00215.69
7.1.300.0080.00615.62
7.1.290.0070.00715.67
7.1.280.0020.01115.62
7.1.270.0070.00815.68
7.1.260.0070.00915.79
7.1.200.0090.00315.48
7.1.100.0000.01417.94
7.1.70.0080.00417.09
7.1.60.0120.01219.40
7.1.50.0130.01316.95
7.1.00.0130.06022.34
7.0.200.0100.00616.48
7.0.140.0000.07022.09
7.0.70.0030.06321.78
7.0.60.0070.07721.79
7.0.50.0070.08322.05
7.0.40.0030.08019.95
7.0.30.0030.05019.95
7.0.20.0030.06720.13
7.0.10.0070.08020.06
7.0.00.0130.07019.99
5.6.280.0100.06720.91
5.6.220.0070.07020.71
5.6.210.0100.07320.71
5.6.200.0130.05721.03
5.6.190.0030.08721.04
5.6.180.0070.08021.11
5.6.170.0100.07021.00
5.6.160.0030.07321.04
5.6.150.0070.06021.05
5.6.140.0030.08021.05
5.6.130.0100.08021.05
5.6.120.0000.08021.09
5.6.110.0030.04321.04
5.6.100.0100.03721.13
5.6.90.0070.03721.00
5.6.80.0070.03720.43
5.6.70.0070.03720.34
5.6.60.0030.04020.42
5.6.50.0000.04320.50
5.6.40.0070.03720.48
5.6.30.0000.04320.40
5.6.20.0070.03320.31
5.6.10.0000.04020.43
5.6.00.0070.03320.30
5.5.360.0030.06720.54
5.5.350.0070.07320.43
5.5.340.0000.09020.87
5.5.330.0000.06720.93
5.5.320.0100.08020.86
5.5.310.0070.06020.94
5.5.300.0100.08020.76
5.5.290.0100.06320.91
5.5.280.0100.07720.77
5.5.270.0030.04320.92
5.5.260.0070.03720.93
5.5.250.0000.04320.73
5.5.240.0000.04020.23
5.5.230.0030.04020.14
5.5.220.0000.04020.20
5.5.210.0000.05720.25
5.5.200.0030.03720.13
5.5.190.0000.04720.12
5.5.180.0030.04020.11
5.5.160.0000.04020.20
5.5.150.0030.03720.18
5.5.140.0000.04020.09
5.5.130.0000.03320.23
5.5.120.0000.03320.13
5.5.110.0000.04020.14
5.5.100.0000.03320.17
5.5.90.0070.02720.16
5.5.80.0030.03020.17
5.5.70.0000.04020.18
5.5.60.0070.03320.15
5.5.50.0000.03320.02
5.5.40.0030.03719.93
5.5.30.0000.04020.12
5.5.20.0030.03720.04
5.5.10.0000.04020.05
5.5.00.0000.04720.12
5.4.450.0130.07719.18
5.4.440.0100.06319.31
5.4.430.0030.04019.30
5.4.420.0000.04019.23
5.4.410.0070.03719.27
5.4.400.0030.03719.07
5.4.390.0030.05319.12
5.4.380.0000.04318.82
5.4.370.0000.04019.15
5.4.360.0000.04719.04
5.4.350.0000.03718.98
5.4.340.0000.04018.98
5.4.320.0000.07319.07
5.4.310.0030.03718.91
5.4.300.0030.02719.13
5.4.290.0030.03719.23
5.4.280.0030.03719.02
5.4.270.0070.02718.97
5.4.260.0030.03019.03
5.4.250.0000.04319.03
5.4.240.0000.05719.04
5.4.230.0000.03719.09
5.4.220.0070.02718.96
5.4.210.0000.03018.96
5.4.200.0030.03319.10
5.4.190.0000.03719.03
5.4.180.0000.04719.12
5.4.170.0000.03318.81
5.4.160.0030.04019.06
5.4.150.0000.03319.03
5.4.140.0030.03316.14
5.4.130.0000.03716.38
5.4.120.0000.03016.36
5.4.110.0000.07316.39
5.4.100.0000.04316.41
5.4.90.0030.03716.39
5.4.80.0000.07316.37
5.4.70.0030.04716.25
5.4.60.0030.07016.21
5.4.50.0070.03316.37
5.4.40.0070.04016.25
5.4.30.0070.04716.30
5.4.20.0030.06016.34
5.4.10.0000.07016.23
5.4.00.0100.07015.83
5.3.290.0000.04314.68
5.3.280.0000.04014.47
5.3.270.0000.03014.61
5.3.260.0070.05314.63
5.3.250.0030.02714.46
5.3.240.0000.03714.48
5.3.230.0000.03714.58
5.3.220.0100.04714.41
5.3.210.0070.07714.58
5.3.200.0000.07314.45
5.3.190.0100.06714.55
5.3.180.0030.07014.57
5.3.170.0030.04314.57
5.3.160.0030.07314.50
5.3.150.0030.07314.45
5.3.140.0000.07714.58
5.3.130.0000.07314.56
5.3.120.0070.05014.52
5.3.110.0030.08014.53
5.3.100.0000.05314.04
5.3.90.0000.06014.00
5.3.80.0030.07713.82
5.3.70.0000.08013.99
5.3.60.0100.05014.03
5.3.50.0000.05013.96
5.3.40.0000.08013.90
5.3.30.0030.06713.87
5.3.20.0000.05013.71
5.3.10.0130.06013.64
5.3.00.0030.04713.59
5.2.170.0000.03712.43
5.2.160.0100.04712.43
5.2.150.0000.06712.43
5.2.140.0000.06312.43
5.2.130.0000.04312.43
5.2.120.0000.03712.43
5.2.110.0030.04012.43
5.2.100.0070.04312.43
5.2.90.0000.05712.43
5.2.80.0030.04012.43
5.2.70.0030.03712.43
5.2.60.0030.06312.43
5.2.50.0000.05712.43
5.2.40.0030.03012.43
5.2.30.0070.06012.43
5.2.20.0030.04312.43
5.2.10.0000.05012.43
5.2.00.0000.04012.43
5.1.60.0030.02712.43
5.1.50.0030.04312.43
5.1.40.0030.05012.43
5.1.30.0070.03312.43
5.1.20.0030.05712.43
5.1.10.0070.05712.43
5.1.00.0030.05312.43
5.0.50.0030.03312.43
5.0.40.0000.05012.43
5.0.30.0070.05012.43
5.0.20.0000.04012.43
5.0.10.0000.04712.43
5.0.00.0070.06012.43
4.4.90.0000.01712.43
4.4.80.0070.03312.43
4.4.70.0070.02012.43
4.4.60.0000.03712.43
4.4.50.0000.03012.43
4.4.40.0000.05712.43
4.4.30.0100.03012.43
4.4.20.0000.03712.43
4.4.10.0030.03312.43
4.4.00.0070.04712.43
4.3.110.0070.03312.43
4.3.100.0030.03312.43
4.3.90.0000.03012.43
4.3.80.0030.05312.43
4.3.70.0030.03312.43
4.3.60.0070.02712.43
4.3.50.0070.02712.43
4.3.40.0070.03312.43
4.3.30.0000.03312.43
4.3.20.0030.02712.43
4.3.10.0000.02312.43
4.3.00.0000.03712.43

preferences:
36.61 ms | 401 KiB | 5 Q