3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(isset($_SESSION)); session_start(); var_dump(isset($_SESSION)); session_destroy(); var_dump(isset($_SESSION));
Output for 7.2.0
bool(false) Warning: session_start(): Cannot start session when headers already sent in /in/0BQF0 on line 4 bool(false) Warning: session_destroy(): Trying to destroy uninitialized session in /in/0BQF0 on line 8 bool(false)
Output for 7.1.0 - 7.1.10
bool(false) Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/0BQF0:2) in /in/0BQF0 on line 4 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/0BQF0:2) in /in/0BQF0 on line 4 bool(true) Warning: session_destroy(): Trying to destroy uninitialized session in /in/0BQF0 on line 8 bool(true)
Output for 4.3.2 - 7.0.20
bool(false) Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/0BQF0:2) in /in/0BQF0 on line 4 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/0BQF0:2) in /in/0BQF0 on line 4 bool(true) bool(true)
Output for 4.3.0 - 4.3.1
bool(false) Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cookie - headers already sent by (output started at /in/0BQF0:2) in /in/0BQF0 on line 4 Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cache limiter - headers already sent (output started at /in/0BQF0:2) in /in/0BQF0 on line 4 bool(true) bool(true)