Personally, I use error exceptions all the time (http://us.php.net/manual/en/class.errorexception.php)...
So, at the beginning of my code, I have the following:
function exception_error_handler($errno, $errstr, $errfile, $errline ) {
throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
set_error_handler("exception_error_handler");
Then, I wrap everyting in a giant try{}catch{} block. So I can "catch" the error higher, but if I don't, it displays an error message to the client:
ob_start();
try {
//Do Stuff Here, include files, etc
} catch (Exception $e) {
ob_end_clean();
//Log the error here, including backtraces so you can debug later
//Either render the error page here, or redirect to a generic error page
}
The beauty is that it'll catch ANY kind of error. So in my DB class, I simply throw a DatabaseException (which extends Exception). So I can try/catch for that when I make my call if I want to fail gracefully, or I can let it be handled by the top try{}catch block.