3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class FileSessionHandler { private $savePath; function open($savePath, $sessionName) { return true; } function close() { return true; } function read($id) { return 'lol|s:222:"1";lol2|s:1:"1";'; } function write($id, $data) { } function destroy($id) { } function gc($maxlifetime) { } } $handler = new FileSessionHandler(); session_set_save_handler( array($handler, 'open'), array($handler, 'close'), array($handler, 'read'), array($handler, 'write'), array($handler, 'destroy'), array($handler, 'gc') ); register_shutdown_function('session_write_close'); session_start(); var_dump($_SESSION);
Output for 7.1.0 - 7.2.0
Warning: session_start(): Session callback expects true/false return value in /in/tWYcZ on line 50 Warning: session_start(): Session object destruction failed in /in/tWYcZ on line 50 Warning: session_start(): Failed to decode session object. Session has been destroyed in /in/tWYcZ on line 50 array(0) { }
Output for 7.0.0 - 7.0.20
Warning: session_start(): Session callback expects true/false return value in /in/tWYcZ on line 50 Warning: session_start(): Session object destruction failed in /in/tWYcZ on line 50 Warning: session_start(): Failed to decode session object. Session has been destroyed in /in/tWYcZ on line 50 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/tWYcZ:50) in /in/tWYcZ on line 50 array(0) { }
Output for 5.5.29 - 5.5.35, 5.6.13 - 5.6.28
Warning: session_start(): Failed to decode session object. Session has been destroyed in /in/tWYcZ on line 50 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/tWYcZ:50) in /in/tWYcZ on line 50 array(0) { }
Output for 5.3.21 - 5.4.44, 5.5.24 - 5.5.28, 5.6.8 - 5.6.12
array(2) { ["lol"]=> NULL ["222:"1";lol2"]=> string(1) "1" }
Output for 5.4.45
Warning: session_start(): Trying to destroy uninitialized session in /in/tWYcZ on line 50 Warning: session_start(): Failed to decode session object. Session has been destroyed in /in/tWYcZ on line 50 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /in/tWYcZ:50) in /in/tWYcZ on line 50 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /in/tWYcZ:50) in /in/tWYcZ on line 50 array(0) { }