You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, PHP Error replaces any existing handlers, and just forces it's self to become the main handler. The problem here, is that people are using PHP Error with existing code, which has existing error handlers.
So PHP Error needs some mechanism for working with these in different ways, and some policy about how it works in relation to others.
According to the PHP docs, a handler is supposed to return true, if the error has been handled. So in theory, PHP Error could run any existing handler set before it, and only run if that handler failed to return true.
The debate comes down to what the default context should be. The way I see it, the options are:
People are using PHP Error to replace any existing error handling, and so should take over the error handler. In this scenario, an option is provided to allow PHP Error to run existing handlers first.
People want to use PHP Error as a fallback for existing error handling, and so should always let an existing handler go first. An option is provided, for PHP Error to ignore this, and let an existing handler go first.
The default behaviour can be decided later, but for now the code should be changed to capture any existing handlers, and allow them to be run before the current handler. A boolean option can then decide if that is on or not (with the default set in the __construct).
The text was updated successfully, but these errors were encountered:
Currently, PHP Error replaces any existing handlers, and just forces it's self to become the main handler. The problem here, is that people are using PHP Error with existing code, which has existing error handlers.
So PHP Error needs some mechanism for working with these in different ways, and some policy about how it works in relation to others.
According to the PHP docs, a handler is supposed to return true, if the error has been handled. So in theory, PHP Error could run any existing handler set before it, and only run if that handler failed to return true.
The debate comes down to what the default context should be. The way I see it, the options are:
The default behaviour can be decided later, but for now the code should be changed to capture any existing handlers, and allow them to be run before the current handler. A boolean option can then decide if that is on or not (with the default set in the __construct).
The text was updated successfully, but these errors were encountered: