接管php 錯誤 異常


set_exception_handler(array('MyClass', 'Exception'));
set_error_handler(array('MyClass', 'Error')); //return false php的錯誤會繼續處理
register_shutdown_function(array('MyClass', 'ShutDown'));
restore_error_handler();
restore_exception_handler();
error_get_last();

error_reporting();
設置應該報告何種 PHP錯誤 http://php.net/manual/zh/function.error-reporting.php
預定義常量  http://php.net/manual/zh/errorfunc.constants.php

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章