I am testing this error handler.
public static function error( $code, $message, $file, $line, $context ) {
if ($code | (E_ALL - (E_NOTICE + E_WARNING + E_USER_NOTICE + E_USER_WARNING )) ) {
/*
* This goes to the javascript console, and arrays are pretty ugly
* when displayed there because of prototype.js extendsions to array.
*/
Core::$errorLog[] = (object) array(
'number' => $code,
'string' => $message,
'file' => $file,
'line' => $line,
'context' => (object) $context,
'trace' => (object) debug_backtrace()
);
// We've handled this error.
return true;
} else { // Throw fatal Exception.
// Not written yet.
}
}
I want it to catch E_DEPRECATED and E_STRICT as well. The code catches non-fatal errors and stores a detailed report for each one, then embeds the results in the output html so javascript can display it in the Firebug console, or similar action (for a javascript output file the errors are logged in a comment text block at the start of the file, if image output is being done a log file is written and so on).