3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ExceptionHandler { public function __construct() { set_exception_handler($this); } public function __invoke(Exception $e) { echo $exception->getMessage(); } } function error($no, $message) { throw new Exception($message); } set_error_handler('error'); new ExceptionHandler; throw new Exception("Test");

preferences:
42.13 ms | 402 KiB | 5 Q