次のスクリプトが与えられた場合
<?php
ini_set('display_errors','On');
error_reporting(E_ALL);
thisisanerror
?>
私は期待される
Notice: Use of undefined constant error - assumed 'error' in /htdocs/test.php on line 8
しかし、スクリプトに何かを追加すると
<?php
ini_set('display_errors','On');
error_reporting(E_ALL);
error
function test () {
echo('test');
}
?>
私は得る
HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.
後者の場合、通常の構文エラーではなく 500 エラーが発生するのはなぜですか? display_errors は常にエラーを表示すべきではありませんか?