Don't use a shutdown function for that purpose, simply write a custom error handler instead and register it with set_error_handler.
We use a custom error handler that will terminate the script, and optionally print out the error with a stack trace and/or send an email.
During development, it shows the error in the browser (with stack trace). In production, it emails a detailed report to the developers.
In both, it logs the error on the PHP error log and halts the script. This applies even to E_NOTICE events.
The principle I use, is that any error should not happen, and therefore the script has failed and must be terminated before it causes some damage.
Mark