Исключение брошено в моей функции отключения и не пойманы в Try/поймать блока, например:Почему set_exception_handler (func) не перехватывает исключения?
<?php
set_exception_handler(function($e){
echo "exception handled"; // not echoed
});
register_shutdown_function(function(){
throw new Exception("test"); // this should be caught by the exception handler above, but it doesn't
});
Запуск выше код дает:
Fatal error: Uncaught exception 'Exception' with message 'test'
Однако PHP Manual претензии:
set_exception_handler sets the default exception handler if an exception is not caught within a try/catch block. Execution will stop after the exception_handler is called.
Почему exception_handler
не поймать исключение?
Однако, как вы утверждаете, документы не упоминаются вообще. В документах для http://php.net/set_exception_handler не указано, что он не входит в область использования вышеприведенного примера. – Pacerier