3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php session_start(); function start() { return $_SESSION['a'] = 1+1; } echo start(); echo $_SESSION['a'];
Output for 5.2.3 - 5.6.21, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
22
Output for 4.4.3 - 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/X0l8s</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/X0l8s:2) in <b>/in/X0l8s</b> on line <b>2</b><br /> 22
Output for 4.3.2 - 4.4.2
<br /> <b>Warning</b>: session_start(): Cannot send session cookie - headers already sent in <b>/in/X0l8s</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/X0l8s:2) in <b>/in/X0l8s</b> on line <b>2</b><br /> 22
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/X0l8s</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/X0l8s:2) in <b>/in/X0l8s</b> on line <b>2</b><br /> 22