3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<pre><?php $path = ini_get('session.save_path') . '/sess_'; var_dump($path); session_start(); // starts session & creates and locks file var_dump( is_file($path . session_id()) ); // -> TRUE session_regenerate_id(); // starts new session, but file is not create! var_dump( is_file($path . session_id()) ); // -> FALSE
Output for 7.2.6
<pre>string(6) "/sess_" Warning: session_start(): Cannot start session when headers already sent in /in/5ksW0 on line 5 Warning: is_file(): open_basedir restriction in effect. File(/sess_) is not within the allowed path(s): (/tmp:/in) in /in/5ksW0 on line 7 bool(false) Warning: session_regenerate_id(): Cannot regenerate session id - session is not active in /in/5ksW0 on line 9 Warning: is_file(): open_basedir restriction in effect. File(/sess_) is not within the allowed path(s): (/tmp:/in) in /in/5ksW0 on line 11 bool(false)
Output for 7.2.0
<pre>string(6) "/sess_" Warning: session_start(): Cannot start session when headers already sent in /in/5ksW0 on line 5 bool(false) Warning: session_regenerate_id(): Cannot regenerate session id - session is not active in /in/5ksW0 on line 9 bool(false)
Output for 7.1.20
<pre>string(6) "/sess_" Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/5ksW0:1) in /in/5ksW0 on line 5 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/5ksW0:1) in /in/5ksW0 on line 5 Warning: is_file(): open_basedir restriction in effect. File(/sess_3bb14ee96916e5665c8cfae0ef9c4ee1) is not within the allowed path(s): (/tmp:/in) in /in/5ksW0 on line 7 bool(false) Warning: session_regenerate_id(): Cannot regenerate session id - session is not active in /in/5ksW0 on line 9 Warning: is_file(): open_basedir restriction in effect. File(/sess_3bb14ee96916e5665c8cfae0ef9c4ee1) is not within the allowed path(s): (/tmp:/in) in /in/5ksW0 on line 11 bool(false)
Output for 7.1.0 - 7.1.10
<pre>string(6) "/sess_" Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/5ksW0:1) in /in/5ksW0 on line 5 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/5ksW0:1) in /in/5ksW0 on line 5 bool(false) Warning: session_regenerate_id(): Cannot regenerate session id - session is not active in /in/5ksW0 on line 9 bool(false)
Output for 5.3.0 - 5.6.30, 7.0.0 - 7.0.20
<pre>string(6) "/sess_" Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/5ksW0:1) in /in/5ksW0 on line 5 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/5ksW0:1) in /in/5ksW0 on line 5 bool(false) Warning: session_regenerate_id(): Cannot regenerate session id - headers already sent in /in/5ksW0 on line 9 bool(false)
Output for hhvm-3.10.1 - 3.17.3
<pre>string(6) "/sess_" bool(false) bool(false)