3v4l.org

run code in 300+ PHP versions simultaneously
<?php function handle_exception( $arg ) { echo "exception callback" . PHP_EOL; } set_exception_handler( 'handle_exception' ); function bar( $arg ) { throw new Exception( 'fail here' ); } ob_start( 'bar' ); exit;
Output for 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
exception callback
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.30

Process exited with code 255.

preferences:
59.99 ms | 968 KiB | 4 Q