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.6
Fatal error: Uncaught TypeError: Session callback must have a return value of type bool, null returned in /in/PFO7A:51 Stack trace: #0 /in/PFO7A(51): session_start() #1 {main} thrown in /in/PFO7A on line 51 register_shutdown_function Object destructor Output buffer callback
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/PFO7A on line 51 Session close Warning: session_start(): Session callback expects true/false return value in /in/PFO7A on line 51 Warning: session_start(): Failed to initialize storage module: user (path: ) in /in/PFO7A on line 51 register_shutdown_function Object destructor Output buffer callback
Output for 7.1.0 - 7.1.25
Warning: session_start(): Session callback expects true/false return value in /in/PFO7A on line 51 Session close Warning: session_start(): Session callback expects true/false return value in /in/PFO7A on line 51 Fatal error: session_start(): Failed to initialize storage module: user (path: ) in /in/PFO7A on line 51 register_shutdown_function Output buffer callback
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/PFO7A on line 51 Fatal error: session_start(): Failed to initialize storage module: user (path: ) in /in/PFO7A 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.2.3 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
register_shutdown_function Object destructor Output buffer callback Session write Session close
Output for 5.1.0 - 5.1.6, 5.2.0 - 5.2.2
Warning: session_start(): Cannot send session cookie - headers already sent in /in/PFO7A on line 51 Warning: session_start(): Cannot send session cache limiter - headers already sent in /in/PFO7A on line 51 register_shutdown_function Object destructor Output buffer callback Session write Session close
Output for 5.0.5
Warning: session_start(): Cannot send session cookie - headers already sent in /in/PFO7A on line 51 Warning: session_start(): Cannot send session cache limiter - headers already sent in /in/PFO7A on line 51 Output buffer callback Object destructor register_shutdown_function Session write Session close
Output for 5.0.0 - 5.0.4
Warning: session_start(): Cannot send session cookie - headers already sent in /in/PFO7A on line 51 Warning: session_start(): Cannot send session cache limiter - headers already sent in /in/PFO7A on line 51 Output buffer callback register_shutdown_function Session write Session close Object destructor
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.9
Warning: session_start(): Cannot send session cookie - headers already sent in /in/PFO7A on line 51 Warning: session_start(): Cannot send session cache limiter - headers already sent in /in/PFO7A on line 51 Output buffer callback register_shutdown_function Session write Session close
Output for 4.3.0 - 4.3.1
Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cookie - headers already sent in /in/PFO7A on line 51 Warning: session_start() [http://www.php.net/function.session-start]: Cannot send session cache limiter - headers already sent in /in/PFO7A on line 51 Output buffer callback register_shutdown_function Session write Session close

preferences:
246.26 ms | 402 KiB | 329 Q