3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php session_start(); $old_sessionid = session_id(); // Set destroyed timestamp $_SESSION['destroyed'] = time(); // Since PHP 7.0.0 and up, session_regenerate_id() saves old session data // Simply calling session_regenerate_id() may result in lost session, etc. // See next example. session_regenerate_id(); print_r($_SESSION);
Output for 5.2.3 - 5.6.30, hhvm-3.10.1 - 3.12.14, hhvm-3.17.3, hhvm-3.18.5 - 3.21.0, hhvm-3.22.0, 7.0.0 - 7.3.0rc3
Array ( [destroyed] => 1514191763 )
Output for hhvm-3.13.2 - 3.15.4, hhvm-3.18.4, hhvm-3.21.3
Array ( [destroyed] => 1514191764 )
Output for 4.4.3 - 4.4.9, 5.2.0 - 5.2.2
Warning: session_start(): Cannot send session cookie - headers already sent in /in/brlJo on line 2 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/brlJo:2) in /in/brlJo on line 2 Warning: session_regenerate_id(): Cannot regenerate session id - headers already sent in /in/brlJo on line 12 Array ( [destroyed] => 1514191763 )
Output for 4.3.2 - 4.4.2, 5.0.0 - 5.1.6
Warning: session_start(): Cannot send session cookie - headers already sent in /in/brlJo on line 2 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/brlJo:2) in /in/brlJo on line 2 Warning: session_regenerate_id(): Cannot send session cookie - headers already sent by (output started at /in/brlJo:2) in /in/brlJo on line 12 Array ( [destroyed] => 1514191763 )
Output for 4.3.0 - 4.3.1
Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cookie - headers already sent in /in/brlJo on line 2 Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cache limiter - headers already sent (output started at /in/brlJo:2) in /in/brlJo on line 2 Fatal error: Call to undefined function: session_regenerate_id() in /in/brlJo on line 12