register_shutdown_function() still outputs original error message
<p>I am trying to replace the built in php shutdown_function with a custom one.</p>

<p>It works perfectly, however, it still outputs the original error (built in error) above my new error message.</p>

<pre><code>  &lt;?php
  function shutdown_output() {
      $error = error_get_last();
      if($error !== NULL) {
          echo "ERROR";
          exit();
      } else {
          echo "NO ERROR";
      }
  }

  // Set the error reporting:
  register_shutdown_function('shutdown_output');

  // test.php does not exist, just here to get a critical error
  require_once("test.php");

  ?&gt;
</code></pre>

<p>Any ideas?</p>
