3v4l.org

run code in 300+ PHP versions simultaneously
<?php function oeffne($speicherpfad, $session_name) { global $sess_speicherpfad; $sess_speicherpfad = $speicherpfad; return(true); } function schliesse() { return(true); } function lese($id) { global $sess_speicherpfad; $sess_datei = "$sess_speicherpfad/sess_$id"; return (string) @file_get_contents($sess_datei); } function schreibe($id, $sess_daten) { global $sess_speicherpfad; $sess_datei = "$sess_speicherpfad/sess_$id"; if ($fp = @fopen($sess_datei, "w")) { $return = fwrite($fp, $sess_daten); fclose($fp); return $return; } else { return(false); } } function loesche($id) { global $sess_speicherpfad; $sess_datei = "$sess_speicherpfad/sess_$id"; return(@unlink($sess_datei)); } function gc($maxlifetime) { global $sess_speicherpfad; foreach (glob("$sess_speicherpfad/sess_*") as $dateiname) { if (filemtime($dateiname) + $maxlifetime < time()) { @unlink($dateiname); } } return true; } session_set_save_handler("oeffne", "schliesse", "lese", "schreibe", "loesche", "gc"); session_start();
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.31, 7.4.0 - 7.4.25, 8.0.0 - 8.0.12
Warning: Unknown: Failed to write session data using user defined save handler. (session.save_path: ) in Unknown on line 0
Output for 7.0.0 - 7.0.33
Warning: Unknown: Failed to write session data (user). Please verify that the current setting of session.save_path is correct () in Unknown on line 0
Output for 5.2.3 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
Output for 4.4.3 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 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/cMujc</b> on line <b>61</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/cMujc:61) in <b>/in/cMujc</b> on line <b>61</b><br />
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.2
<br /> <b>Warning</b>: session_start(): Cannot send session cookie - headers already sent in <b>/in/cMujc</b> on line <b>61</b><br /> <br /> <b>Warning</b>: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/cMujc:61) in <b>/in/cMujc</b> on line <b>61</b><br />
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/cMujc</b> on line <b>61</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/cMujc:61) in <b>/in/cMujc</b> on line <b>61</b><br />

preferences:
295.6 ms | 402 KiB | 386 Q