3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test implements SessionHandlerInterface { public function close ( ){} public function destroy ( $session_id ){} public function gc ( $maxlifetime ){} public function open ( $save_path , $session_name ){} public function read ( $session_id ){} public function write ( $session_id , $session_data ){} } $test = new Test(); session_set_save_handler($test); session_start();
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
Deprecated: Return type of Test::open($save_path, $session_name) should either be compatible with SessionHandlerInterface::open(string $path, string $name): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/sK30J on line 8 Deprecated: Return type of Test::close() should either be compatible with SessionHandlerInterface::close(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/sK30J on line 5 Deprecated: Return type of Test::read($session_id) should either be compatible with SessionHandlerInterface::read(string $id): string|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/sK30J on line 9 Deprecated: Return type of Test::write($session_id, $session_data) should either be compatible with SessionHandlerInterface::write(string $id, string $data): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/sK30J on line 10 Deprecated: Return type of Test::destroy($session_id) should either be compatible with SessionHandlerInterface::destroy(string $id): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/sK30J on line 6 Deprecated: Return type of Test::gc($maxlifetime) should either be compatible with SessionHandlerInterface::gc(int $max_lifetime): int|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/sK30J on line 7 Warning: session_set_save_handler(): Session save handler cannot be changed after headers have already been sent in /in/sK30J on line 14 Warning: session_start(): Session cannot be started after headers have already been sent in /in/sK30J on line 15
Output for 8.0.0 - 8.0.30
Fatal error: Uncaught TypeError: Session callback must have a return value of type bool, null returned in /in/sK30J:15 Stack trace: #0 /in/sK30J(15): session_start() #1 {main} thrown in /in/sK30J on line 15
Process exited with code 255.
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: session_start(): Session callback expects true/false return value in /in/sK30J on line 15 Warning: session_start(): Session callback expects true/false return value in /in/sK30J on line 15 Warning: session_start(): Failed to initialize storage module: user (path: ) in /in/sK30J on line 15
Output for 7.1.0 - 7.1.33
Warning: session_start(): Session callback expects true/false return value in /in/sK30J on line 15 Warning: session_start(): Session callback expects true/false return value in /in/sK30J on line 15 Fatal error: session_start(): Failed to initialize storage module: user (path: ) in /in/sK30J on line 15
Process exited with code 255.
Output for 7.0.0 - 7.0.33
Warning: session_start(): Session callback expects true/false return value in /in/sK30J on line 15 Fatal error: session_start(): Failed to initialize storage module: user (path: ) in /in/sK30J on line 15 Warning: Unknown: Session callback expects true/false return value in Unknown on line 0
Process exited with code 255.
Output for 5.6.0 - 5.6.40

preferences:
190.29 ms | 401 KiB | 292 Q