3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $old_sessionid = session_id(); session_regenerate_id(); $new_sessionid = session_id(); echo "Old Session: $old_sessionid<br />"; echo "New Session: $new_sessionid<br />"; print_r($_SESSION);
Output for 7.0.0 - 7.1.0
Warning: session_regenerate_id(): Cannot regenerate session id - session is not active in /in/IULU5 on line 3 Old Session: <br />New Session: <br /> Notice: Undefined variable: _SESSION in /in/IULU5 on line 7
Output for 5.5.0 - 5.6.28
Old Session: <br />New Session: <br /> Notice: Undefined variable: _SESSION in /in/IULU5 on line 7
Output for 4.3.2 - 4.4.2, 5.0.0 - 5.1.6, 5.2.3 - 5.4.45
Old Session: <br />New Session: <br />
Output for 4.4.3 - 4.4.9, 5.2.0 - 5.2.2
<br /> <b>Warning</b>: session_regenerate_id() [<a href='function.session-regenerate-id'>function.session-regenerate-id</a>]: Cannot regenerate session id - headers already sent in <b>/in/IULU5</b> on line <b>3</b><br /> Old Session: <br />New Session: <br />
Output for 4.3.0 - 4.3.1
<br /> <b>Fatal error</b>: Call to undefined function: session_regenerate_id() in <b>/in/IULU5</b> on line <b>3</b><br />