3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?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
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.14
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.6.28
Output for 4.3.2 - 5.2.2
Warning: session_start(): Cannot send session cookie - headers already sent in /in/cMujc on line 61 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/cMujc:61) in /in/cMujc on line 61
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/cMujc on line 61 Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cache limiter - headers already sent (output started at /in/cMujc:61) in /in/cMujc on line 61