3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); $error_message = ""; // ログインボタンが押されたかを判定 // 初めてのアクセスでは認証は行わずエラーメッセージは表示しない if (isset($_POST["login"])) { // ID・パスの入力チェック( if(empty($_POST["user_id"])){ $error_message = "(empty)ユーザID・パスワードを入力してください"; exit(); } if(empty($_POST["password])){ $error_message = "(empty)ユーザID・パスワードを入力してください"; exit(); } if (is_numeric($_POST["user_id"]) == false) { $error_message = "IDは半角数字で入力してください"; exit(); } if (is_numeric($_POST["password"]) == false) { $error_message = "パスワードは半角英数字で入力してください"; exit(); } // 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)
5.4.260.0270.07019.24
5.4.250.0300.07019.09
5.4.240.0200.07319.16
5.4.230.0230.06718.98
5.4.220.0230.04019.21
5.4.210.0270.03719.16
5.4.200.0230.04018.97
5.4.190.0200.07319.30
5.4.180.0130.04719.21
5.4.170.0200.04319.31
5.4.160.0270.03719.11
5.4.150.0300.06719.11
5.4.140.0230.05716.36
5.4.130.0300.06016.38
5.4.120.0330.05016.32
5.4.110.0230.07016.37
5.4.100.0230.06716.54
5.4.90.0270.06016.59
5.4.80.0200.04016.26
5.4.70.0270.06716.39
5.4.60.0200.04316.34
5.4.50.0230.06716.44
5.4.40.0170.04316.51
5.4.30.0230.05716.51
5.4.20.0300.05316.15
5.4.10.0130.05016.27
5.4.00.0130.06715.80
5.3.280.0870.04714.55
5.3.270.2400.03314.46
5.3.260.2130.03714.46
5.3.250.2330.03714.70
5.3.240.2230.03014.46
5.3.230.2170.03314.63
5.3.220.2370.04014.66
5.3.210.2470.04014.52
5.3.200.2430.04314.42
5.3.190.2330.04314.55
5.3.180.2230.03314.42
5.3.170.2500.03314.50
5.3.160.2330.03714.47
5.3.150.2270.04314.41
5.3.140.2200.03314.41
5.3.130.2500.05014.59
5.3.120.2330.04014.49
5.3.110.2770.03014.39
5.3.100.2430.04713.89
5.3.90.0970.05014.01
5.3.80.0000.04013.87
5.3.70.0000.04013.89
5.3.60.2230.04013.79
5.3.50.0430.03713.93
5.3.40.0330.04313.82
5.3.30.0300.05013.89
5.3.20.0200.03713.70
5.3.10.0200.03313.49
5.3.00.0200.03313.59

preferences:
240.03 ms | 1394 KiB | 8 Q