3v4l.org

run code in 300+ PHP versions simultaneously
<?php include "connect.php"; session_start(); date_default_timezone_set('UTC'); if($_SESSION['user']){ } else{ header("location:index.php"); } if($_SERVER['REQUEST_METHOD'] = "POST") //Added an if to keep the page secured { $details = $con->real_escape_string($_POST['details']); $time = strftime("%X");//time $date = strftime("%B %d, %Y");//date $decision ="no"; $con->select_db("main") or die("Cannot connect to database"); //Connect to database foreach($_POST['public'] as $each_check) //gets the data from the checkbox { if($each_check !=null ){ //checks if the checkbox is checked $decision = "yes"; //sets teh value } } $con->query("INSERT INTO list (details, date_posted, time_posted, public) VALUES ('$details','$date','$time','$decision')"); //SQL query header("location: home.php"); } else { header("location:home.php"); //redirects back to hom } ?>
Output for 8.3.0 - 8.3.6
Warning: include(): open_basedir restriction in effect. File(connect.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/65jIM on line 2 Warning: include(connect.php): Failed to open stream: Operation not permitted in /in/65jIM on line 2 Warning: include(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Session cannot be started after headers have already been sent in /in/65jIM on line 3 Warning: Undefined global variable $_SESSION in /in/65jIM on line 5 Warning: Trying to access array offset on null in /in/65jIM on line 5 Warning: Cannot modify header information - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 8 Warning: Undefined variable $con in /in/65jIM on line 13 Fatal error: Uncaught Error: Call to a member function real_escape_string() on null in /in/65jIM:13 Stack trace: #0 {main} thrown in /in/65jIM on line 13
Process exited with code 255.
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18
Warning: include(): open_basedir restriction in effect. File(connect.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/65jIM on line 2 Warning: include(connect.php): Failed to open stream: Operation not permitted in /in/65jIM on line 2 Warning: include(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Session cannot be started after headers have already been sent in /in/65jIM on line 3 Warning: Undefined global variable $_SESSION in /in/65jIM on line 5 Warning: Trying to access array offset on value of type null in /in/65jIM on line 5 Warning: Cannot modify header information - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 8 Warning: Undefined variable $con in /in/65jIM on line 13 Fatal error: Uncaught Error: Call to a member function real_escape_string() on null in /in/65jIM:13 Stack trace: #0 {main} thrown in /in/65jIM on line 13
Process exited with code 255.
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30
Warning: include(): open_basedir restriction in effect. File(connect.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/65jIM on line 2 Warning: include(connect.php): Failed to open stream: Operation not permitted in /in/65jIM on line 2 Warning: include(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Session cannot be started after headers have already been sent in /in/65jIM on line 3 Warning: Undefined variable $_SESSION in /in/65jIM on line 5 Warning: Trying to access array offset on value of type null in /in/65jIM on line 5 Warning: Cannot modify header information - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 8 Warning: Undefined variable $con in /in/65jIM on line 13 Fatal error: Uncaught Error: Call to a member function real_escape_string() on null in /in/65jIM:13 Stack trace: #0 {main} thrown in /in/65jIM on line 13
Process exited with code 255.
Output for 8.0.13
Warning: include(connect.php): Failed to open stream: No such file or directory in /in/65jIM on line 2 Warning: include(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Session cannot be started after headers have already been sent in /in/65jIM on line 3 Warning: Undefined variable $_SESSION in /in/65jIM on line 5 Warning: Trying to access array offset on value of type null in /in/65jIM on line 5 Warning: Cannot modify header information - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 8 Warning: Undefined variable $con in /in/65jIM on line 13 Fatal error: Uncaught Error: Call to a member function real_escape_string() on null in /in/65jIM:13 Stack trace: #0 {main} thrown in /in/65jIM on line 13
Process exited with code 255.
Output for 7.4.33
Warning: include(connect.php): failed to open stream: No such file or directory in /in/65jIM on line 2 Warning: include(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Cannot start session when headers already sent in /in/65jIM on line 3 Notice: Undefined variable: _SESSION in /in/65jIM on line 5 Notice: Trying to access array offset on value of type null in /in/65jIM on line 5 Warning: Cannot modify header information - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 8 Notice: Undefined variable: con in /in/65jIM on line 13 Fatal error: Uncaught Error: Call to a member function real_escape_string() on null in /in/65jIM:13 Stack trace: #0 {main} thrown in /in/65jIM on line 13
Process exited with code 255.
Output for 7.4.0 - 7.4.32
Warning: include(): open_basedir restriction in effect. File(connect.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/65jIM on line 2 Warning: include(connect.php): failed to open stream: Operation not permitted in /in/65jIM on line 2 Warning: include(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Cannot start session when headers already sent in /in/65jIM on line 3 Notice: Undefined variable: _SESSION in /in/65jIM on line 5 Notice: Trying to access array offset on value of type null in /in/65jIM on line 5 Warning: Cannot modify header information - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 8 Notice: Undefined variable: con in /in/65jIM on line 13 Fatal error: Uncaught Error: Call to a member function real_escape_string() on null in /in/65jIM:13 Stack trace: #0 {main} thrown in /in/65jIM on line 13
Process exited with code 255.
Output for 7.3.32 - 7.3.33
Warning: include(connect.php): failed to open stream: No such file or directory in /in/65jIM on line 2 Warning: include(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Cannot start session when headers already sent in /in/65jIM on line 3 Warning: Cannot modify header information - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 8 Fatal error: Uncaught Error: Call to a member function real_escape_string() on null in /in/65jIM:13 Stack trace: #0 {main} thrown in /in/65jIM on line 13
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.31
Warning: include(): open_basedir restriction in effect. File(connect.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/65jIM on line 2 Warning: include(connect.php): failed to open stream: Operation not permitted in /in/65jIM on line 2 Warning: include(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Cannot start session when headers already sent in /in/65jIM on line 3 Notice: Undefined variable: _SESSION in /in/65jIM on line 5 Warning: Cannot modify header information - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 8 Notice: Undefined variable: con in /in/65jIM on line 13 Fatal error: Uncaught Error: Call to a member function real_escape_string() on null in /in/65jIM:13 Stack trace: #0 {main} thrown in /in/65jIM on line 13
Process exited with code 255.
Output for 7.1.25 - 7.1.33
Warning: include(): open_basedir restriction in effect. File(connect.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/65jIM on line 2 Warning: include(connect.php): failed to open stream: Operation not permitted in /in/65jIM on line 2 Warning: include(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/65jIM:2) in /in/65jIM on line 3 Notice: Undefined index: user in /in/65jIM on line 5 Warning: Cannot modify header information - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 8 Notice: Undefined variable: con in /in/65jIM on line 13 Fatal error: Uncaught Error: Call to a member function real_escape_string() on null in /in/65jIM:13 Stack trace: #0 {main} thrown in /in/65jIM on line 13
Process exited with code 255.
Output for 7.1.20
Warning: include(): open_basedir restriction in effect. File(connect.php) is not within the allowed path(s): (/tmp:/in) in /in/65jIM on line 2 Warning: include(connect.php): failed to open stream: Operation not permitted in /in/65jIM on line 2 Warning: include(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/65jIM:2) in /in/65jIM on line 3 Notice: Undefined index: user in /in/65jIM on line 5 Warning: Cannot modify header information - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 8 Notice: Undefined variable: con in /in/65jIM on line 13 Fatal error: Uncaught Error: Call to a member function real_escape_string() on null in /in/65jIM:13 Stack trace: #0 {main} thrown in /in/65jIM on line 13
Process exited with code 255.
Output for 7.0.5 - 7.0.20, 7.1.0 - 7.1.10
Warning: include(connect.php): failed to open stream: No such file or directory in /in/65jIM on line 2 Warning: include(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/65jIM:2) in /in/65jIM on line 3 Notice: Undefined index: user in /in/65jIM on line 5 Warning: Cannot modify header information - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 8 Notice: Undefined variable: con in /in/65jIM on line 13 Fatal error: Uncaught Error: Call to a member function real_escape_string() on null in /in/65jIM:13 Stack trace: #0 {main} thrown in /in/65jIM on line 13
Process exited with code 255.
Output for 7.0.0 - 7.0.4
Warning: include(connect.php): failed to open stream: No such file or directory in /in/65jIM on line 2 Warning: include(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/65jIM:2) in /in/65jIM on line 3 Notice: Undefined index: user in /in/65jIM on line 5 Warning: Cannot modify header information - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 8 Notice: Undefined variable: con in /in/65jIM on line 13 Fatal error: Uncaught Error: Call to a member function real_escape_string() on unknown in /in/65jIM:13 Stack trace: #0 {main} thrown in /in/65jIM on line 13
Process exited with code 255.
Output for 5.6.8 - 5.6.28
Warning: include(connect.php): failed to open stream: No such file or directory in /in/65jIM on line 2 Warning: include(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/65jIM:2) in /in/65jIM on line 3 Notice: Undefined index: user in /in/65jIM on line 5 Warning: Cannot modify header information - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 8 Notice: Undefined variable: con in /in/65jIM on line 13 Fatal error: Call to a member function real_escape_string() on null in /in/65jIM on line 13
Process exited with code 255.
Output for 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35
Warning: include(connect.php): failed to open stream: No such file or directory in /in/65jIM on line 2 Warning: include(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/65jIM:2) in /in/65jIM on line 3 Notice: Undefined index: user in /in/65jIM on line 5 Warning: Cannot modify header information - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 8 Notice: Undefined variable: con in /in/65jIM on line 13 Fatal error: Call to a member function real_escape_string() on a non-object in /in/65jIM on line 13
Process exited with code 255.
Output for 5.2.3 - 5.2.17
Warning: include(connect.php): failed to open stream: No such file or directory in /in/65jIM on line 2 Warning: include(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/65jIM:2) in /in/65jIM on line 3 Notice: Undefined index: user in /in/65jIM on line 5 Warning: Cannot modify header information - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 8 Notice: Undefined variable: con in /in/65jIM on line 13 Fatal error: Call to a member function real_escape_string() on a non-object in /in/65jIM on line 13
Process exited with code 255.
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.2
Warning: include(connect.php): failed to open stream: No such file or directory in /in/65jIM on line 2 Warning: include(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/65jIM:2) in /in/65jIM on line 3 Notice: Undefined index: user in /in/65jIM on line 5 Notice: Undefined variable: con in /in/65jIM on line 13 Fatal error: Call to a member function real_escape_string() on a non-object in /in/65jIM on line 13
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Warning: main(connect.php): failed to open stream: No such file or directory in /in/65jIM on line 2 Warning: main(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/65jIM:2) in /in/65jIM on line 3 Fatal error: Call to undefined function date_default_timezone_set() in /in/65jIM on line 4
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Warning: main(connect.php): failed to open stream: No such file or directory in /in/65jIM on line 2 Warning: main(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/65jIM:2) in /in/65jIM on line 3 Fatal error: Call to undefined function: date_default_timezone_set() in /in/65jIM on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Warning: main(connect.php): failed to open stream: No such file or directory in /in/65jIM on line 2 Warning: main(): Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/65jIM:2) in /in/65jIM on line 3 Fatal error: Call to undefined function: date_default_timezone_set() in /in/65jIM on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: main(connect.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /in/65jIM on line 2 Warning: main() [http://www.php.net/function.main]: Failed opening 'connect.php' for inclusion (include_path='.:') in /in/65jIM on line 2 Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cookie - headers already sent by (output started at /in/65jIM:2) in /in/65jIM on line 3 Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cache limiter - headers already sent (output started at /in/65jIM:2) in /in/65jIM on line 3 Fatal error: Call to undefined function: date_default_timezone_set() in /in/65jIM on line 4

preferences:
264.52 ms | 403 KiB | 358 Q