3v4l.org

run code in 300+ PHP versions simultaneously
<?php session_start(); if ((!isset($_SESSION["username"]) && !isset($_SESSION["s1"]) && !isset($_SESSION["s2"]))) { $_SESSION["firstrun"] = "true"; $_POST = array(); } ?> <!DOCTYPE html> <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="jquery-1.11.0.js"></script> </head> <script> $(function() { $('#enter').click(function() { console.log("clicky"); //Debug //Get value from the inputs var user_input = $("#username").val(); var s1_input = $("#s1").val(); var s2_input = $("#s2").val(); //Make a jquery post to the session.php with the users data and then redirect to the next page jQuery.post("session.php", {username:user_input, s1:s1_input, s2:s2_input}, function(data){ if (data == "true") { window.location.replace("strings.php"); // Javascript redirect } }); }); }); </script> <body> Enter a username: <input type="text" name="username" id="username" value=""/> <br/> <br/> Pick a string: <input type="text" name="s1" id="s1" value=""/> <br/> <br/> Pick another string: <input type="text" name="s2" id="s2" value=""/> <br/> <br/> <input type="button" name="enter" id="enter" value="Go play with strings!"/> <br/> <br/> </body> </html>
Output for 5.2.3 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.35, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.10, 7.2.0 - 7.2.33, 7.3.12 - 7.3.31, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
<!DOCTYPE html> <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="jquery-1.11.0.js"></script> </head> <script> $(function() { $('#enter').click(function() { console.log("clicky"); //Debug //Get value from the inputs var user_input = $("#username").val(); var s1_input = $("#s1").val(); var s2_input = $("#s2").val(); //Make a jquery post to the session.php with the users data and then redirect to the next page jQuery.post("session.php", {username:user_input, s1:s1_input, s2:s2_input}, function(data){ if (data == "true") { window.location.replace("strings.php"); // Javascript redirect } }); }); }); </script> <body> Enter a username: <input type="text" name="username" id="username" value=""/> <br/> <br/> Pick a string: <input type="text" name="s1" id="s1" value=""/> <br/> <br/> Pick another string: <input type="text" name="s2" id="s2" value=""/> <br/> <br/> <input type="button" name="enter" id="enter" value="Go play with strings!"/> <br/> <br/> </body> </html>
Output for 7.3.33
Warning: session_start(): open(/tmp/sess_19aeab9a91f8ca4ff653f6b85203a343, O_RDWR) failed: No space left on device (28) in /in/BaVg1 on line 2 Warning: session_start(): Failed to read session data: files (path: ) in /in/BaVg1 on line 2 <!DOCTYPE html> <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="jquery-1.11.0.js"></script> </head> <script> $(function() { $('#enter').click(function() { console.log("clicky"); //Debug //Get value from the inputs var user_input = $("#username").val(); var s1_input = $("#s1").val(); var s2_input = $("#s2").val(); //Make a jquery post to the session.php with the users data and then redirect to the next page jQuery.post("session.php", {username:user_input, s1:s1_input, s2:s2_input}, function(data){ if (data == "true") { window.location.replace("strings.php"); // Javascript redirect } }); }); }); </script> <body> Enter a username: <input type="text" name="username" id="username" value=""/> <br/> <br/> Pick a string: <input type="text" name="s1" id="s1" value=""/> <br/> <br/> Pick another string: <input type="text" name="s2" id="s2" value=""/> <br/> <br/> <input type="button" name="enter" id="enter" value="Go play with strings!"/> <br/> <br/> </body> </html>
Output for 7.3.32
Warning: session_start(): open(/tmp/sess_d5c43898e21596ee7612d273a22cab2e, O_RDWR) failed: No space left on device (28) in /in/BaVg1 on line 2 Warning: session_start(): Failed to read session data: files (path: ) in /in/BaVg1 on line 2 <!DOCTYPE html> <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="jquery-1.11.0.js"></script> </head> <script> $(function() { $('#enter').click(function() { console.log("clicky"); //Debug //Get value from the inputs var user_input = $("#username").val(); var s1_input = $("#s1").val(); var s2_input = $("#s2").val(); //Make a jquery post to the session.php with the users data and then redirect to the next page jQuery.post("session.php", {username:user_input, s1:s1_input, s2:s2_input}, function(data){ if (data == "true") { window.location.replace("strings.php"); // Javascript redirect } }); }); }); </script> <body> Enter a username: <input type="text" name="username" id="username" value=""/> <br/> <br/> Pick a string: <input type="text" name="s1" id="s1" value=""/> <br/> <br/> Pick another string: <input type="text" name="s2" id="s2" value=""/> <br/> <br/> <input type="button" name="enter" id="enter" value="Go play with strings!"/> <br/> <br/> </body> </html>
Output for 4.4.3 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.2
<br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/in/BaVg1</b> on line <b>2</b><br /> <br /> <b>Warning</b>: session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /in/BaVg1:2) in <b>/in/BaVg1</b> on line <b>2</b><br /> <!DOCTYPE html> <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="jquery-1.11.0.js"></script> </head> <script> $(function() { $('#enter').click(function() { console.log("clicky"); //Debug //Get value from the inputs var user_input = $("#username").val(); var s1_input = $("#s1").val(); var s2_input = $("#s2").val(); //Make a jquery post to the session.php with the users data and then redirect to the next page jQuery.post("session.php", {username:user_input, s1:s1_input, s2:s2_input}, function(data){ if (data == "true") { window.location.replace("strings.php"); // Javascript redirect } }); }); }); </script> <body> Enter a username: <input type="text" name="username" id="username" value=""/> <br/> <br/> Pick a string: <input type="text" name="s1" id="s1" value=""/> <br/> <br/> Pick another string: <input type="text" name="s2" id="s2" value=""/> <br/> <br/> <input type="button" name="enter" id="enter" value="Go play with strings!"/> <br/> <br/> </body> </html>
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.2
<br /> <b>Warning</b>: session_start(): Cannot send session cookie - headers already sent in <b>/in/BaVg1</b> on line <b>2</b><br /> <br /> <b>Warning</b>: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/BaVg1:2) in <b>/in/BaVg1</b> on line <b>2</b><br /> <!DOCTYPE html> <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="jquery-1.11.0.js"></script> </head> <script> $(function() { $('#enter').click(function() { console.log("clicky"); //Debug //Get value from the inputs var user_input = $("#username").val(); var s1_input = $("#s1").val(); var s2_input = $("#s2").val(); //Make a jquery post to the session.php with the users data and then redirect to the next page jQuery.post("session.php", {username:user_input, s1:s1_input, s2:s2_input}, function(data){ if (data == "true") { window.location.replace("strings.php"); // Javascript redirect } }); }); }); </script> <body> Enter a username: <input type="text" name="username" id="username" value=""/> <br/> <br/> Pick a string: <input type="text" name="s1" id="s1" value=""/> <br/> <br/> Pick another string: <input type="text" name="s2" id="s2" value=""/> <br/> <br/> <input type="button" name="enter" id="enter" value="Go play with strings!"/> <br/> <br/> </body> </html>
Output for 4.3.0 - 4.3.1
<br /> <b>Warning</b>: session_start() [<a href='http://www.php.net/function.session-start'>function.session-start</a>]: Cannot send session cookie - headers already sent in <b>/in/BaVg1</b> on line <b>2</b><br /> <br /> <b>Warning</b>: session_start() [<a href='http://www.php.net/function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /in/BaVg1:2) in <b>/in/BaVg1</b> on line <b>2</b><br /> <!DOCTYPE html> <html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script src="jquery-1.11.0.js"></script> </head> <script> $(function() { $('#enter').click(function() { console.log("clicky"); //Debug //Get value from the inputs var user_input = $("#username").val(); var s1_input = $("#s1").val(); var s2_input = $("#s2").val(); //Make a jquery post to the session.php with the users data and then redirect to the next page jQuery.post("session.php", {username:user_input, s1:s1_input, s2:s2_input}, function(data){ if (data == "true") { window.location.replace("strings.php"); // Javascript redirect } }); }); }); </script> <body> Enter a username: <input type="text" name="username" id="username" value=""/> <br/> <br/> Pick a string: <input type="text" name="s1" id="s1" value=""/> <br/> <br/> Pick another string: <input type="text" name="s2" id="s2" value=""/> <br/> <br/> <input type="button" name="enter" id="enter" value="Go play with strings!"/> <br/> <br/> </body> </html>

preferences:
255.17 ms | 404 KiB | 339 Q