There is a note "Shutdown function is called during the script shutdown so headers are always already sent.", but my php 5.1 seems to act differently.
Example:
<?php
class Test {
private $running;
public function main() {
$this->running = true;
ob_start();
error_reporting(E_ALL);
register_shutdown_function(array($this, "clean_exit"));
echo "Hello";
// triggers E_ERROR
$fatal->error();
$this->running = false;
}
public function clean_exit() {
if ($this->running) {
header("Location: error.php");
}
}
}
$t = new Test();
$t->main();
?>
This example redirects you on error.php, this could be a simple way to handle E_ERROR.