You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally reported here https://bugs.php.net/bug.php?id=81451
However, while the original issue won't necessarily require a fix/just a documentation update, I want to take this issue further and report it as a bug, since this behavior makes it impossible to retrieve the actual HTTP status code after it was changed with http_response_status()
Since headers_list() does not contain the original header() either, it's impossible to identify the actual HTTP response code when the HTTP response header was set manually and it was later overwritten (since the overwritten value is not actually used)
I think the way forward with this issue is:
if the header is manually set already and http_response_code( 123 ) is used, PHP should emit a warning, that this has no effect since the HTTP status is manually set
with the next major version, remove this warning again and actually fix the behavior, so http_response_code will actually overwrite any manual HTTP response code headers
PHP Version
PHP 8.4
Operating System
No response
The text was updated successfully, but these errors were encountered:
Description
Originally reported here https://bugs.php.net/bug.php?id=81451
However, while the original issue won't necessarily require a fix/just a documentation update, I want to take this issue further and report it as a bug, since this behavior makes it impossible to retrieve the actual HTTP status code after it was changed with http_response_status()
The following code:
Resulted in this output:
But I expected this output instead:
Since headers_list() does not contain the original header() either, it's impossible to identify the actual HTTP response code when the HTTP response header was set manually and it was later overwritten (since the overwritten value is not actually used)
I think the way forward with this issue is:
PHP Version
Operating System
No response
The text was updated successfully, but these errors were encountered: