3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Admin Panel</title> <link href="style.css" type="text/css" rel="stylesheet" /> </head> <body id="admin"> <div id="wrapper"> <?php if(isset($_SESSION['name'])) { echo "<h3>Welcome to the Admin Panel, ". $_SESSION['name']."</h3>"; } else { header('location: index.php'); } ?> <p><a href="logout.php">Logout</a></p> </div> </body> </html>
Output for 5.2.3 - 7.1.0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Admin Panel</title> <link href="style.css" type="text/css" rel="stylesheet" /> </head> <body id="admin"> <div id="wrapper"> Warning: Cannot modify header information - headers already sent by (output started at /in/PBfLB:12) in /in/PBfLB on line 16 <p><a href="logout.php">Logout</a></p> </div> </body> </html>
Output for 4.3.2 - 5.2.2
Warning: session_start(): Cannot send session cookie - headers already sent in /in/PBfLB on line 1 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/PBfLB:1) in /in/PBfLB on line 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Admin Panel</title> <link href="style.css" type="text/css" rel="stylesheet" /> </head> <body id="admin"> <div id="wrapper"> <p><a href="logout.php">Logout</a></p> </div> </body> </html>
Output for 4.3.0 - 4.3.1
Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cookie - headers already sent in /in/PBfLB on line 1 Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cache limiter - headers already sent (output started at /in/PBfLB:1) in /in/PBfLB on line 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Admin Panel</title> <link href="style.css" type="text/css" rel="stylesheet" /> </head> <body id="admin"> <div id="wrapper"> <p><a href="logout.php">Logout</a></p> </div> </body> </html>