ABSTRACT

The first rule of professional, modern PHP error handling is that die(error()) is dead. It has no benefits to offer and works against a positive user experience as well as undermining security by revealing system details to untrusted sources. PHP has two error reporting systems in place, Errors and Exceptions. Each produces its own messages, and both need to be captured, privately logged, and never revealed as raw data to the user.