3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Handler { public function register() { return set_exception_handler([$this, 'handle']); } public function handle($e) { die("Exception reached"); } } $h = (new Handler())->register(); throw new Exception("Not handled");

preferences:
40.48 ms | 402 KiB | 5 Q