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> <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.0140.00718.27
8.3.50.0140.00621.21
8.3.40.0140.00718.74
8.3.30.0100.00719.12
8.3.20.0070.00020.20
8.3.10.0050.00322.08
8.3.00.0080.00022.47
8.2.180.0090.00916.48
8.2.170.0100.00622.96
8.2.160.0090.00619.29
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0070.00726.16
8.2.120.0000.01419.24
8.2.110.0140.00722.28
8.2.100.0110.00319.31
8.2.90.0000.00819.34
8.2.80.0090.00018.05
8.2.70.0070.00317.63
8.2.60.0060.00317.93
8.2.50.0050.00318.07
8.2.40.0060.00318.34
8.2.30.0030.00618.21
8.2.20.0030.00517.86
8.2.10.0060.00317.75
8.2.00.0040.00717.73
8.1.280.0080.00625.92
8.1.270.0050.00222.06
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0100.00023.78
8.1.230.0120.00019.17
8.1.220.0040.00417.78
8.1.210.0040.00418.77
8.1.200.0260.01317.48
8.1.190.0000.00817.53
8.1.180.0060.00320.58
8.1.170.0040.00418.59
8.1.160.0050.00322.29
8.1.150.0040.00418.72
8.1.140.0000.00817.55
8.1.130.0030.00317.95
8.1.120.0060.00317.56
8.1.110.0040.00417.58
8.1.100.0000.00717.39
8.1.90.0040.00417.51
8.1.80.0070.00017.45
8.1.70.0040.00417.48
8.1.60.0050.00517.71
8.1.50.0000.00917.50
8.1.40.0040.00417.55
8.1.30.0040.00417.73
8.1.20.0050.00317.74
8.1.10.0000.00917.59
8.1.00.0080.00017.49
8.0.300.0000.00818.77
8.0.290.0040.00417.30
8.0.280.0040.00418.52
8.0.270.0070.00017.29
8.0.260.0060.00016.82
8.0.250.0070.00016.88
8.0.240.0070.00017.09
8.0.230.0000.00716.89
8.0.220.0000.00816.97
8.0.210.0030.00316.93
8.0.200.0070.00016.96
8.0.190.0000.00817.09
8.0.180.0000.00717.03
8.0.170.0050.00316.95
8.0.160.0070.00017.00
8.0.150.0000.00716.93
8.0.140.0040.00416.81
8.0.130.0030.00313.29
8.0.120.0060.00316.80
8.0.110.0080.00016.85
8.0.100.0060.00316.95
8.0.90.0000.00816.89
8.0.80.0030.01116.98
8.0.70.0040.00417.05
8.0.60.0030.00516.82
8.0.50.0030.00516.88
8.0.30.0100.00817.13
8.0.20.0120.00617.40
8.0.10.0000.00716.96
8.0.00.0070.01116.78
7.4.330.0020.00215.00
7.4.320.0000.00616.66
7.4.300.0030.00316.52
7.4.290.0000.00816.58
7.4.280.0000.00816.64
7.4.270.0030.00316.64
7.4.260.0080.00016.55
7.4.250.0000.00716.51
7.4.240.0030.00316.68
7.4.230.0000.00716.68
7.4.220.0070.01016.56
7.4.210.0060.00816.67
7.4.200.0030.00316.49
7.4.190.0000.00716.53
7.4.160.0000.01616.45
7.4.150.0090.00917.40
7.4.140.0210.01517.86
7.4.130.0100.00816.63
7.4.120.0090.00916.52
7.4.110.0040.01416.64
7.4.100.0130.01016.61
7.4.90.0140.00316.60
7.4.80.0090.00919.39
7.4.70.0150.00916.36
7.4.60.0060.01216.31
7.4.50.0040.00416.14
7.4.40.0030.01422.77
7.4.30.0090.01016.71
7.4.00.0030.01314.81
7.3.330.0030.00313.11
7.3.320.0030.00313.18
7.3.310.0000.00716.19
7.3.300.0000.00716.24
7.3.290.0060.01416.29
7.3.280.0060.00916.29
7.3.270.0070.01117.40
7.3.260.0030.01616.23
7.3.250.0100.00716.30
7.3.240.0070.01716.46
7.3.230.0060.01616.39
7.3.210.0100.00716.53
7.3.200.0130.00319.39
7.3.190.0090.01216.37
7.3.180.0120.00916.25
7.3.170.0110.00516.29
7.3.160.0090.01316.38
7.3.120.0040.01214.84
7.3.10.0030.01016.62
7.3.00.0120.00316.59
7.2.330.0150.00316.63
7.2.320.0150.00416.55
7.2.310.0070.01016.49
7.2.300.0510.03316.53
7.2.290.0100.01016.68
7.2.130.0040.00816.81
7.2.120.0040.01116.71
7.2.110.0070.00716.88
7.2.100.0070.00716.86
7.2.90.0110.00416.49
7.2.80.0050.00516.72
7.2.70.0060.01216.90
7.2.60.0090.00616.79
7.2.50.0140.00016.73
7.2.40.0030.00917.04
7.2.30.0070.01016.75
7.2.20.0040.01116.89
7.2.10.0040.00716.80
7.2.00.0080.00618.28
7.1.250.0070.00715.85
7.1.100.0040.00818.04
7.1.70.0000.00716.94
7.1.60.0070.00317.31
7.1.50.0140.01016.78
7.1.00.0070.03722.36
7.0.200.0060.00916.91
7.0.140.0030.07721.99
7.0.60.0070.09019.95
7.0.50.0170.05717.92
7.0.40.0030.06719.98
7.0.30.0230.08320.25
7.0.20.0270.06020.14
7.0.10.0230.08020.16
7.0.00.0130.06320.00
5.6.280.0000.07321.08
5.6.210.0070.07020.61
5.6.200.0100.05018.15
5.6.190.0070.06720.56
5.6.180.3700.04720.52
5.6.170.0100.04720.51
5.6.160.0100.08020.52
5.6.150.0100.07318.12
5.6.140.0070.08018.10
5.6.130.0100.07318.21
5.6.120.0030.05021.04
5.6.110.0070.05321.06
5.6.100.0030.07321.15
5.6.90.0070.08021.00
5.6.80.0030.07720.39
5.6.70.0170.08020.39
5.5.350.0070.05020.41
5.5.340.0070.06317.93
5.5.330.0100.08720.29
5.5.320.0400.06720.18
5.5.310.0200.06320.28
5.5.300.0030.06317.95
5.5.290.0030.07317.96
5.5.280.0200.07720.96
5.5.270.0200.07720.85
5.5.260.0030.04320.83
5.5.250.0030.04320.71
5.5.240.0130.04020.15
5.4.450.0700.06319.63
5.4.440.1000.07319.64
5.4.430.0070.05319.54
5.4.420.0970.05019.63
5.4.410.0830.04719.20
5.4.400.0330.07318.60
5.4.390.0270.05018.50
5.4.380.0300.07018.47
5.4.370.0170.05018.73
5.4.360.0170.05018.68
5.4.350.0170.05318.72
5.4.340.0170.05018.67
5.4.320.0090.03712.48
5.4.310.0060.04412.47
5.4.300.0070.03712.48
5.4.290.0070.04312.48
5.4.280.0070.03912.37
5.4.270.0100.03212.37
5.4.260.0070.06018.87
5.4.250.0070.06019.01
5.4.240.0070.06018.73
5.4.230.0070.05718.69
5.4.220.0100.07318.92
5.4.210.0030.05718.91
5.4.200.0130.07018.89
5.4.190.0130.07018.93
5.4.180.0170.07018.88
5.4.170.0130.05319.02
5.4.160.0070.05318.98
5.4.150.0230.06719.00
5.4.140.0230.06016.29
5.4.130.0070.05316.28
5.4.120.0070.05716.28
5.4.110.0170.06316.58
5.4.100.0130.04716.52
5.4.90.0100.05316.50
5.4.80.0170.05716.47
5.4.70.0130.04716.21
5.4.60.0070.07016.47
5.4.50.0100.05716.39
5.4.40.0030.06316.37
5.4.30.0100.05316.37
5.4.20.0030.05316.49
5.4.10.0100.05716.50
5.4.00.0070.05315.93
5.3.290.0060.04212.80
5.3.280.0070.05314.61
5.3.270.0130.07314.50
5.3.260.0070.05314.31
5.3.250.0100.06314.63
5.3.240.0070.07014.61
5.3.230.0170.06314.77
5.3.220.0100.04714.46
5.3.210.0100.07014.73
5.3.200.0100.04714.45
5.3.190.0070.07314.68
5.3.180.0030.05314.59
5.3.170.0100.05714.44
5.3.160.0170.05314.45
5.3.150.0070.07014.59
5.3.140.0100.06714.58
5.3.130.0200.04014.48
5.3.120.0200.05714.66
5.3.110.0100.05014.61
5.3.100.0070.05014.09
5.3.90.0130.05313.88
5.3.80.0030.05314.03
5.3.70.0100.04713.87
5.3.60.0170.04314.11
5.3.50.0070.06313.68
5.3.40.0230.03713.66
5.3.30.0070.05013.98
5.3.20.0070.05313.54
5.3.10.0070.04713.66
5.3.00.0170.04313.49
5.2.170.0130.03711.27
5.2.160.0000.05011.16
5.2.150.0030.04311.05
5.2.140.0070.04711.07
5.2.130.0030.04310.88
5.2.120.0030.04311.12
5.2.110.0030.06011.05
5.2.100.0070.04011.04
5.2.90.0100.03711.13
5.2.80.0100.05310.99
5.2.70.0100.03710.99
5.2.60.0100.04311.08
5.2.50.0100.04011.05
5.2.40.0070.04011.02
5.2.30.0030.04310.99
5.2.20.0030.04311.08
5.2.10.0070.04711.03
5.2.00.0070.05710.80
5.1.60.0070.03710.05
5.1.50.0000.05310.01
5.1.40.0000.0409.97
5.1.30.0100.04310.50
5.1.20.0030.05310.45
5.1.10.0100.03710.08
5.1.00.0030.05010.06
5.0.50.0000.0408.62
5.0.40.0000.0408.31
5.0.30.0000.0438.13
5.0.20.0000.0408.20
5.0.10.0070.0238.16
5.0.00.0000.0478.01
4.4.90.0000.0237.30
4.4.80.0000.0237.30
4.4.70.0100.0237.30
4.4.60.0030.0237.30
4.4.50.0000.0307.30
4.4.40.0000.0377.30
4.4.30.0070.0177.30
4.4.20.0000.0277.30
4.4.10.0030.0277.30
4.4.00.0030.0337.30
4.3.110.0070.0177.30
4.3.100.0000.0237.30
4.3.90.0070.0277.30
4.3.80.0000.0337.30
4.3.70.0000.0307.30
4.3.60.0000.0307.30
4.3.50.0000.0237.30
4.3.40.0100.0377.30
4.3.30.0030.0307.30
4.3.20.0000.0237.30
4.3.10.0000.0337.30
4.3.00.0100.0277.27

preferences:
51.54 ms | 401 KiB | 5 Q