set_exception_handler

Supported Versions: PHP 5, PHP 7, PHP 8
Sets a user-defined exception handler function
<?php set_exception_handler(?callable $callback): ?callable
<?php         set_error_handler($this->forwardsTo('handleError'));



        set_exception_handler($this->forwardsTo('handleException'));



        register_shutdown_function($this->forwardsTo('handleShutdown'));
<?php     public static function flushHandlersState()

    {

        while (true) {

            $previousHandler = set_exception_handler(static fn () => null);



            restore_exception_handler();
<?php         set_error_handler([$this, 'renderError']);




        set_exception_handler([$this, 'handleException']);



        return $this;

    }
<?php     echo 'never';

});



set_exception_handler(function (Exception $e) {

    echo 'Uncaught error occured' . PHP_EOL;

    Loop::stop();

});



throw new RuntimeException();