3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Warning: session_regenerate_id(): Session ID cannot be regenerated when there is no active session in /in/IULU5 on line 3 Old Session: <br />New Session: <br /> Warning: Undefined global variable $_SESSION in /in/IULU5 on line 7
Output for 8.0.0 - 8.0.30
Warning: session_regenerate_id(): Session ID cannot be regenerated when there is no active session in /in/IULU5 on line 3 Old Session: <br />New Session: <br /> Warning: Undefined variable $_SESSION in /in/IULU5 on line 7
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.12 - 7.3.31, 7.4.0 - 7.4.25, 7.4.27 - 7.4.33
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 7.3.32 - 7.3.33, 7.4.26
Warning: session_regenerate_id(): Cannot regenerate session id - session is not active in /in/IULU5 on line 3 Old Session: <br />New Session: <br />
Output for 5.5.0 - 5.5.35, 5.6.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.3.11, 4.4.0 - 4.4.2, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.3 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 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 />

preferences:
238.18 ms | 401 KiB | 344 Q