3v4l.org

run code in 300+ PHP versions simultaneously
<?php // capture any unexpected output and exit execution ob_start(function($buffer) { echo 'unexpected output: ' . $buffer . "\n"; exit; }, 1); // do some work on shutdown register_shutdown_function(function() { ob_flush(); ob_end_clean(); echo 'shutting down'; });
Output for 8.0.0 - 8.0.11, 8.1rc1 - rc2
unexpected output:
Output for 7.3.0 - 7.3.30, 7.4.0 - 7.4.23
Fatal error: Unknown: Cannot use output buffering in output buffering display handlers in Unknown on line 0
Process exited with code 255.

preferences:
45.2 ms | 460 KiB | 5 Q