why does this syntax error return HTTP error 500 when 'display_errors' is on?
<p>given the following script</p>

<pre><code>&lt;?php

ini_set('display_errors','On');
error_reporting(E_ALL);

thisisanerror

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

<p>I get the expected</p>

<pre><code>Notice: Use of undefined constant error - assumed 'error' in /htdocs/test.php on line 8
</code></pre>

<p>but if I add something to the script</p>

<pre><code>&lt;?php

ini_set('display_errors','On');
error_reporting(E_ALL);

error

function test () {

    echo('test');

}

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

<p>I get</p>

<pre><code>HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
</code></pre>

<p>Why am I getting a 500 error instead of a normal syntax error in the latter case? Shouldn't display_errors always display the error?</p>
