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)){ $toto = session_start(true); }
based on ZmfFe
Output for 7.3.0alpha1 - 7.3.0rc4
Warning: session_start() expects parameter 1 to be array, bool given in /in/LEXc5 on line 39
Output for 7.0.0 - 7.2.6
Warning: session_start() expects parameter 1 to be array, boolean given in /in/LEXc5 on line 39
Output for hhvm-3.11.1 - 3.17.3
Fatal error: Uncaught TypeError: Argument 2 passed to __SystemLib\session_set_save_handler() must be an instance of bool, null given in /in/LEXc5:38 Stack trace: #0 /in/LEXc5(38): session_set_save_handler() #1 {main}
Process exited with code 255.
Output for hhvm-3.10.1
Warning: session_start() expects exactly 0 parameters, 1 given in /in/LEXc5 on line 39
Output for 5.4.0 - 5.6.30
Output for 5.3.0 - 5.3.29
Fatal error: Interface 'SessionHandlerInterface' not found in /in/LEXc5 on line 5
Process exited with code 255.
Output for 5.0.5 - 5.2.17
Fatal error: Interface 'SessionHandlerInterface' not found in /in/LEXc5 on line 4
Process exited with code 255.
Output for 5.0.0 - 5.0.4
Fatal error: Class 'SessionHandlerInterface' not found in /in/LEXc5 on line 4
Process exited with code 255.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting '{' in /in/LEXc5 on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting '{' in /in/LEXc5 on line 4
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `'{'' in /in/LEXc5 on line 4
Process exited with code 255.