3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class MySessionStorage implements SessionHandlerInterface { private $path; function open($savePath, $sessionName) { $this->path = $savePath; } function close() { } function read($id) { return ''; } function write($id, $data) { return TRUE; } function destroy($id) { return TRUE; } function gc($maxlifetime) { return TRUE; } } if (session_set_save_handler(new MySessionStorage)){ try{ session_start(); } catch (Exception $e){ } }
based on vZm6A
Output for 7.2.0
Warning: session_start(): Session callback expects true/false return value in /in/Vdq8R on line 40 Warning: session_start(): Session callback expects true/false return value in /in/Vdq8R on line 40 Warning: session_start(): Failed to initialize storage module: user (path: ) in /in/Vdq8R on line 40
Output for 7.1.0 - 7.1.10
Warning: session_start(): Session callback expects true/false return value in /in/Vdq8R on line 40 Warning: session_start(): Session callback expects true/false return value in /in/Vdq8R on line 40 Fatal error: session_start(): Failed to initialize storage module: user (path: ) in /in/Vdq8R on line 40
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Warning: session_start(): Session callback expects true/false return value in /in/Vdq8R on line 40 Fatal error: session_start(): Failed to initialize storage module: user (path: ) in /in/Vdq8R on line 40 Warning: Unknown: Session callback expects true/false return value in Unknown on line 0
Process exited with code 255.
Output for 5.4.10 - 5.6.28
Output for 5.3.20 - 5.3.29
Fatal error: Interface 'SessionHandlerInterface' not found in /in/Vdq8R on line 5
Process exited with code 255.