Hi!请登陆

PHP的框架常用函数

2020-10-31 57 10/31

spl_autoload_register、set_exception_handler和set_error_handler、get_include_path等。

spl_autoload_register

__autoload函数一样,但是更灵活。他的功能是当程序找不到当前正在使用的类时,在报错前,会调用此函数,如果找到了,就继续工作。

set_exception_handler

接管了原本的异常处理,可以隐藏或者美化输出,可以用throw new Exception触发。

set_error_handler

同上,接管了错误处理。可以用trigger_error触发。

相关推荐