PHP ignores custom error handler
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/277224/how-do-i-catch-a-php-fatal-error">How do I catch a PHP Fatal Error</a>  </p>
</blockquote>



<p>I want to create a custom error handler but PHP ignores it still uses the built in error handler. The example below gives a built in fatal error because test() is not defined:</p>

<pre><code> function critical_error($error_number,$error_string,$error_file,$error_line,$error_context) {
     echo "&lt;strong&gt;error:&lt;/strong&gt; echo ".$error_string;
     exit();
 }

 set_error_handler("critical_error",8191);
 test();
 exit;
</code></pre>

<p>Any advice?</p>
