Is it possible to configure PHP to send down a different response code on parse errors?
It seems that the server / php returns 200 "OK", even if there's a parse error. It would seem more appropriate to return a 500 "Internal Server Error", since that's much more accurate.
I know there's a header() function, but that won't work if the script has errors, will it?
Return 500 Response Code on Parse Errors, not 200
Moderator: General Moderators
Re: Return 500 Response Code on Parse Errors, not 200
Code: Select all
function errorhandler {
header('HTTP 500');
print('500!');
}
set_error_handler('errorhandler');