ID: 46510 Updated by: [EMAIL PROTECTED] Reported By: plcplc at gmail dot com -Status: Open +Status: Bogus Bug Type: *Web Server problem Operating System: Debian Linux PHP Version: 5.2.6 New Comment:
See bug #41342 Previous Comments: ------------------------------------------------------------------------ [2008-11-06 15:41:39] plcplc at gmail dot com Description: ------------ Currently PHP doesn't tamper with the HTTP error code at all. It would be nice if errors could trigger the 500 Internal Server Error, because it seems semantically correct. Also, it would enable programs parsing output (e.g. an AJAX client) to easily identify failure on the server, rather than starting to parse the output to find an error suddenly occuring in the output. The XMLHttpRequest function commonly used today actually supports calling a user designated function upon HTTP-response codes different from the usual 200 OK, which is why it would be nice to have PHP actually report the error. Of course, it's not possible to change the header once the headers have been sent, but in many cases they haven't. Reproduce code: --------------- foo(); // call an undefined function Expected result: ---------------- HTTP/1.1 500 Internal Server Error Actual result: -------------- HTTP1/1 200 OK ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46510&edit=1