3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Testing shutdown sequence function shutdown() { echo "register_shutdown_function\n"; } register_shutdown_function('shutdown'); class MyClass { function __destruct() { echo "Object destructor\n"; } } function obcallback($buffer) { $buffer .= "Output buffer callback\n"; return $buffer; } ob_start('obcallback'); $myObject = new MyClass; function dummy() { } function sessionclose() { echo "Session close\n"; } function sessionwrite() { echo "Session write\n"; } session_set_save_handler('dummy','sessionclose','dummy','sessionwrite','dummy','dummy'); session_start(); ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Fatal error: Uncaught TypeError: Session callback must have a return value of type bool, null returned in /in/pfICE:51 Stack trace: #0 /in/pfICE(51): session_start() #1 {main} thrown in /in/pfICE on line 51 register_shutdown_function Object destructor Output buffer callback
Process exited with code 255.
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Fatal error: Uncaught TypeError: Session callback must have a return value of type bool, null returned in /in/pfICE:51 Stack trace: #0 /in/pfICE(51): session_start() #1 {main} thrown in /in/pfICE on line 51 register_shutdown_function Object destructor Output buffer callback
Process exited with code 255.
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Warning: session_start(): Session callback expects true/false return value in /in/pfICE on line 51 Session close Warning: session_start(): Session callback expects true/false return value in /in/pfICE on line 51 Warning: session_start(): Failed to initialize storage module: user (path: ) in /in/pfICE on line 51 register_shutdown_function Object destructor Output buffer callback
Output for 7.1.0 - 7.1.33
Warning: session_start(): Session callback expects true/false return value in /in/pfICE on line 51 Session close Warning: session_start(): Session callback expects true/false return value in /in/pfICE on line 51 Fatal error: session_start(): Failed to initialize storage module: user (path: ) in /in/pfICE on line 51 register_shutdown_function Output buffer callback
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/pfICE on line 51 Fatal error: session_start(): Failed to initialize storage module: user (path: ) in /in/pfICE on line 51 register_shutdown_function Output buffer callback Session close Warning: Unknown: Session callback expects true/false return value in Unknown on line 0
Process exited with code 255.
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
register_shutdown_function Object destructor Output buffer callback Session write Session close

preferences:
239.56 ms | 402 KiB | 339 Q