3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump($_SESSION); session_start(); $_SESSION["test"] = 123; var_dump($_SESSION); session_write_close(); $_SESSION["test"] = 123456; var_dump($_SESSION);
Output for 7.2.0 - 7.2.6
Notice: Undefined variable: _SESSION in /in/VQtQC on line 2 NULL Warning: session_start(): Cannot start session when headers already sent in /in/VQtQC on line 3 array(1) { ["test"]=> int(123) } array(1) { ["test"]=> int(123456) }
Output for 5.0.4 - 7.1.20
Notice: Undefined variable: _SESSION in /in/VQtQC on line 2 NULL Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/VQtQC:2) in /in/VQtQC on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/VQtQC:2) in /in/VQtQC on line 3 array(1) { ["test"]=> int(123) } array(1) { ["test"]=> int(123456) }
Output for 4.3.2 - 5.0.3
Notice: Undefined variable: _SESSION in /in/VQtQC on line 2 NULL Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/VQtQC:2) in /in/VQtQC on line 3 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/VQtQC:2) in /in/VQtQC on line 3 array(1) { ["test"]=> int(123) } array(1) { ["test"]=> int(123456) }
Output for 4.3.0 - 4.3.1
Notice: Undefined variable: _SESSION in /in/VQtQC on line 2 NULL Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cookie - headers already sent by (output started at /in/VQtQC:2) in /in/VQtQC 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/VQtQC:2) in /in/VQtQC on line 3 array(1) { ["test"]=> int(123) } array(1) { ["test"]=> int(123456) }