3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); $error_message = ""; // ログインボタンが押されたかを判定 // 初めてのアクセスでは認証は行わずエラーメッセージは表示しないように if (isset($_POST["login"])) { // ID・パスの入力チェック(未実装、現状はIDに半角数字以外を入れるとおかしくなる) // DB $url = "localhost"; $user = "root"; $pass = ""; $db = "test"; // MySQLへ接続する $link = mysql_connect($url,$user,$pass) or die("MySQLへの接続に失敗しました。"); // データベースを選択する $sdb = mysql_select_db($db,$link) or die("データベースの選択に失敗しました。"); // クエリを送信する ID・パス照会 $sql = "select * from user "; $sql.= "where user_id= " . $_REQUEST["user_id"] ; $result = mysql_query($sql, $link) or die("クエリの送信に失敗しました。<br/>SQL:".$sql); $row = mysql_fetch_assoc($result); // ①パスワードが一致する場合、ログイン if ($row["password"] == $_REQUEST["password"]){ // ログインが成功した証をセッションに保存 $_SESSION["user_id"] = $_REQUEST["user_id"]; $_SESSION["name"] = $row["name"]; $_SESSION["user_class"] = $row["class"]; // トップ画面へリダイレクト $login_url = "top.php"; header("Location: {$login_url}"); } // ②一致しない場合、エラーメッセージを格納 else{ $error_message = "ID・パスワードをお確かめください。"; } // MySQLへの接続を閉じる mysql_close($link) or die("MySQL切断に失敗しました。"); // ボタン判定終わり } ?> <html> <head> <META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=\"Shift_JIS\"> <title>ログイン画面</title> </head> <body> <center> <br> <br> <font size="2" >日程調整ツール「作成さん」</font><br> <br> <font size="5" >ログイン</font><br> <br> <br> <?php if ($error_message) { print '<font color="red">'.$error_message.'</font>'; } ?> <!-- できたらフォーム位置整えたい --> <form action="login.php" method="POST">      ID:<input type="text" name="user_id" value="" /><br /> パスワード:<input type="password" name="password" value"" /><br /> <input type="submit" name="login" value="送信" /> </form> </center> </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)
8.3.60.0100.01018.48
8.3.50.0090.01221.14
8.3.40.0070.00718.76
8.3.30.0040.01119.18
8.3.20.0080.00020.12
8.3.10.0080.00022.02
8.3.00.0060.00320.83
8.2.180.0120.00616.50
8.2.170.0060.01022.96
8.2.160.0110.01119.22
8.2.150.0040.00424.18
8.2.140.0060.00324.66
8.2.130.0030.00526.16
8.2.120.0080.00019.12
8.2.110.0060.00319.38
8.2.100.0090.00317.92
8.2.90.0000.00817.88
8.2.80.0090.00018.76
8.2.70.0050.00318.16
8.2.60.0000.00918.22
8.2.50.0060.00318.10
8.2.40.0040.00421.14
8.2.30.0040.00419.25
8.2.20.0040.00417.79
8.2.10.0000.00717.78
8.2.00.0000.01017.82
8.1.280.0070.00725.92
8.1.270.0000.00822.14
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0000.01122.06
8.1.230.0030.00918.96
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0070.00317.35
8.1.190.0060.00317.23
8.1.180.0070.00318.10
8.1.170.0040.00418.59
8.1.160.0030.00519.03
8.1.150.0040.00418.74
8.1.140.0030.00517.47
8.1.130.0000.00717.84
8.1.120.0030.00417.41
8.1.110.0000.00817.49
8.1.100.0000.00817.54
8.1.90.0000.00717.49
8.1.80.0070.00017.39
8.1.70.0000.00717.45
8.1.60.0000.00817.72
8.1.50.0000.00917.64
8.1.40.0050.00317.64
8.1.30.0040.00417.71
8.1.20.0080.00017.61
8.1.10.0060.00317.64
8.1.00.0040.00417.52
8.0.300.0090.00018.78
8.0.290.0000.00816.88
8.0.280.0000.00718.54
8.0.270.0000.00717.29
8.0.260.0030.00316.94
8.0.250.0030.00317.05
8.0.240.0030.00316.91
8.0.230.0000.00717.07
8.0.220.0000.00716.95
8.0.210.0000.00716.91
8.0.200.0060.00317.00
8.0.190.0080.00016.91
8.0.180.0000.00717.08
8.0.170.0080.00016.96
8.0.160.0000.00816.88
8.0.150.0040.00416.99
8.0.140.0000.00716.88
8.0.130.0030.00313.36
8.0.120.0030.00516.75
8.0.110.0000.00716.85
8.0.100.0040.00417.00
8.0.90.0000.00716.97
8.0.80.0090.00616.94
8.0.70.0040.00416.95
8.0.60.0040.00417.01
8.0.50.0000.00816.80
8.0.30.0210.00817.11
8.0.20.0100.01117.40
8.0.10.0070.00017.03
8.0.00.0130.00816.65
7.4.330.0020.00215.00
7.4.320.0030.00316.63
7.4.300.0000.00616.63
7.4.290.0030.00316.66
7.4.280.0030.00416.56
7.4.270.0030.00316.66
7.4.260.0090.00316.55
7.4.250.0040.00416.53
7.4.240.0040.00316.57
7.4.230.0030.00316.45
7.4.220.0090.00916.74
7.4.210.0040.01116.61
7.4.200.0040.00416.76
7.4.190.0000.00716.59
7.4.160.0070.01416.56
7.4.150.0180.00717.40
7.4.140.0110.00617.86
7.4.130.0120.00616.57
7.4.120.0100.00716.61
7.4.110.0070.01016.45
7.4.100.0090.01316.55
7.4.90.0110.01016.66
7.4.80.0070.01119.39
7.4.70.0090.01116.49
7.4.60.0070.01716.48
7.4.50.0030.00516.68
7.4.40.0040.01122.77
7.4.30.0160.00916.42
7.4.00.0030.01014.79
7.3.330.0030.00313.09
7.3.320.0000.00513.16
7.3.310.0000.00716.20
7.3.300.0070.00016.25
7.3.290.0000.01516.22
7.3.280.0070.01016.29
7.3.270.0080.00817.40
7.3.260.0060.01216.66
7.3.250.0110.00516.27
7.3.240.0030.01416.48
7.3.230.0090.00916.39
7.3.210.0120.00616.42
7.3.200.0070.01716.55
7.3.190.0070.01016.49
7.3.180.0150.00816.42
7.3.170.0000.01616.27
7.3.160.0120.00916.19
7.3.120.0070.01014.82
7.3.10.0020.01116.54
7.3.00.0110.00316.69
7.2.330.0070.01316.66
7.2.320.0110.00816.71
7.2.310.0100.00616.44
7.2.300.0120.00616.77
7.2.290.0170.00316.71
7.2.130.0020.01316.80
7.2.120.0060.00716.75
7.2.110.0070.00816.73
7.2.100.0100.00416.75
7.2.90.0070.00516.65
7.2.80.0060.01016.59
7.2.70.0070.00716.70
7.2.60.0040.01016.79
7.2.50.0080.00316.93
7.2.40.0070.00816.67
7.2.30.0070.00716.70
7.2.20.0040.00916.82
7.2.10.0080.00716.83
7.2.00.0030.00816.57
7.1.250.0090.00515.51
7.1.200.0000.00915.89
7.1.70.0000.01217.19
7.1.60.0070.01419.82
7.1.50.0070.01016.86
7.1.00.0000.04022.48
7.0.200.0030.00316.88
7.0.140.0070.07021.95
7.0.100.0030.04020.09
7.0.90.0170.07020.20
7.0.80.0130.07719.95
7.0.70.0030.05019.92
7.0.60.0000.05720.15
7.0.50.0030.05020.33
7.0.40.0070.08720.18
7.0.30.0100.06720.13
7.0.20.0030.08720.15
7.0.10.0000.04320.11
7.0.00.0170.07720.03
5.6.250.0130.06720.60
5.6.240.0130.07020.52
5.6.230.0070.06320.63
5.6.220.0030.04020.62
5.6.210.0070.08720.46
5.6.200.0070.08321.08
5.6.190.0030.07720.94
5.6.180.0070.07721.05
5.6.170.0170.07321.04
5.6.160.0130.07021.14
5.6.150.0000.04321.19
5.6.140.0170.07320.96
5.6.130.0170.07021.07
5.6.120.0100.07720.95
5.6.110.0130.03021.02
5.6.100.0030.04020.94
5.6.90.0070.07721.02
5.6.80.0100.03020.39
5.6.70.0070.08320.46
5.6.60.0070.03320.31
5.6.50.0030.04720.49
5.6.40.0070.07320.44
5.6.30.0000.06020.32
5.6.20.0070.04720.41
5.6.10.0070.04020.44
5.6.00.0030.04020.48
5.5.380.0030.05020.36
5.5.370.0000.06720.43
5.5.360.0030.08020.41
5.5.350.0070.07320.38
5.5.340.0100.06720.92
5.5.330.0100.03320.75
5.5.320.0170.07020.84
5.5.310.0100.07320.83
5.5.300.0100.07720.92
5.5.290.0030.08720.91
5.5.280.0030.06720.83
5.5.270.0070.03720.90
5.5.260.0070.03720.64
5.5.250.0030.04020.68
5.5.240.0070.06320.26
5.5.230.0100.07320.30
5.5.220.0070.08020.21
5.5.210.0070.07020.07
5.5.200.0100.05020.13
5.5.190.0100.03020.14
5.5.180.0100.07320.24
5.5.160.0030.04019.98
5.5.150.0000.04320.16
5.5.140.0130.03320.23
5.5.130.0070.04020.28
5.5.120.0070.04020.08
5.5.110.0030.04320.13
5.5.100.0130.03020.15
5.5.90.0030.03720.16
5.5.80.0000.03720.05
5.5.70.0030.04319.95
5.5.60.0030.03019.96
5.5.50.0070.03020.04
5.5.40.0000.03720.05
5.5.30.0030.03320.10
5.5.20.0030.03720.13
5.5.10.0070.03320.14
5.5.00.0030.04020.02
5.4.450.0070.07719.38
5.4.440.0030.05719.29
5.4.430.0000.05719.08
5.4.420.0100.05319.29
5.4.410.0100.06719.01
5.4.400.0070.05719.10
5.4.390.0000.08319.10
5.4.380.0070.06319.06
5.4.370.0170.06718.95
5.4.360.0030.07319.06
5.4.350.0000.04719.13
5.4.340.0070.06018.84
5.4.320.0030.03719.12
5.4.310.0030.03719.07
5.4.300.0070.03319.14
5.4.290.0070.03719.23
5.4.280.0130.03018.90
5.4.270.0030.04019.03
5.4.260.0000.04319.03
5.4.250.0070.03319.15
5.4.240.0070.03018.80
5.4.230.0000.03319.14
5.4.220.0000.03318.96
5.4.210.0030.03019.13
5.4.200.0070.02719.13
5.4.190.0070.02718.84
5.4.180.0100.03018.95
5.4.170.0000.03319.08
5.4.160.0030.03019.09
5.4.150.0070.03019.05
5.4.140.0130.02316.37
5.4.130.0070.02716.36
5.4.120.0030.03016.12
5.4.110.0030.03716.22
5.4.100.0100.03016.40
5.4.90.0000.03316.40
5.4.80.0100.02716.19
5.4.70.0070.02716.34
5.4.60.0030.02716.35
5.4.50.0170.02716.18
5.4.40.0100.02316.40
5.4.30.0070.03016.18
5.4.20.0030.03316.20
5.4.10.0000.03316.30
5.4.00.0000.03015.77
5.3.290.0070.04014.69
5.3.280.0030.03014.44
5.3.270.0000.03314.44
5.3.260.0070.02714.61
5.3.250.0070.02714.48
5.3.240.0030.03014.58
5.3.230.0030.03714.53
5.3.220.0030.03714.44
5.3.210.0030.03014.49
5.3.200.0030.03014.42
5.3.190.0000.04314.52
5.3.180.0000.03314.55
5.3.170.0030.03014.59
5.3.160.0030.03014.56
5.3.150.0000.04014.52
5.3.140.0030.03014.39
5.3.130.0000.03314.47
5.3.120.0030.04314.40
5.3.110.0030.03314.54
5.3.100.0070.03014.01
5.3.90.0030.03013.98
5.3.80.0030.03013.94
5.3.70.0030.03014.04
5.3.60.0070.02713.96
5.3.50.0000.03313.96
5.3.40.0130.05313.93
5.3.30.0030.03013.86
5.3.20.0000.06013.52
5.3.10.0030.06713.57
5.3.00.0000.07013.51
5.2.170.0030.02311.53
5.2.160.0070.02311.53
5.2.150.0070.05011.53
5.2.140.0030.05011.53
5.2.130.0030.02711.53
5.2.120.0000.03011.53
5.2.110.0030.05011.53
5.2.100.0030.05311.53
5.2.90.0070.05711.53
5.2.80.0000.05011.53
5.2.70.0000.03711.53
5.2.60.0000.04711.53
5.2.50.0030.02711.53
5.2.40.0030.03711.53
5.2.30.0000.06011.53
5.2.20.0000.03311.53
5.2.10.0070.02311.53
5.2.00.0070.05311.53
5.1.60.0030.02711.53
5.1.50.0070.02011.53
5.1.40.0100.01711.53
5.1.30.0070.04711.53
5.1.20.0000.03011.53
5.1.10.0200.01311.53
5.1.00.0030.03711.53
5.0.50.0030.02011.53
5.0.40.0000.03711.53
5.0.30.0030.06311.53
5.0.20.0000.02011.53
5.0.10.0070.01711.53
5.0.00.0030.06011.53
4.4.90.0000.02711.53
4.4.80.0000.01711.53
4.4.70.0000.01311.53
4.4.60.0070.02311.53
4.4.50.0030.01311.53
4.4.40.0000.02311.53
4.4.30.0000.01711.53
4.4.20.0030.03311.53
4.4.10.0030.02311.53
4.4.00.0070.05011.53
4.3.110.0000.01311.53
4.3.100.0000.01311.53
4.3.90.0000.03711.53
4.3.80.0100.02711.53
4.3.70.0030.01011.53
4.3.60.0030.01311.53
4.3.50.0030.03711.53
4.3.40.0000.03711.53
4.3.30.0030.01311.53
4.3.20.0030.03711.53
4.3.10.0000.01711.53
4.3.00.0000.03711.53

preferences:
43.17 ms | 401 KiB | 5 Q