Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有一种简单的方法来触发 PHP 关闭,以便error_get_last函数从注册的函数中返回真正的错误register_shutdown_function。我需要它来测试我在压力条件下的自定义错误处理和邮件功能。
error_get_last
register_shutdown_function
<?php function shutdown() { echo "shutdown:\n"; print_r(error_get_last()); } register_shutdown_function('shutdown'); throw new Exception("fatal error"); print("END")
trigger_error("You goin' down!", E_USER_ERROR);