php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65791 Mixing header('Status', and other header with int $http_response_code
Submitted: 2013-09-30 17:20 UTC Modified: 2013-10-14 10:54 UTC
From: rainer-phpbugs at 7val dot com Assigned:
Status: Not a bug Package: HTTP related
PHP Version: 5.4.20 OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rainer-phpbugs at 7val dot com
New email:
PHP Version: OS:

 

 [2013-09-30 17:20 UTC] rainer-phpbugs at 7val dot com
Description:
------------
The int $http_response_code for later calls to header() don't update any earlier codes set with header('Status: ???'). The Documentation claims that it "Forces the HTTP response code to the specified value". If header('Status: ...') has not been used beforehand, setting http_response_code works as expected.

Test script:
---------------
<?php
header('Status: 500 Internat Server Error', true, 500);
header('Status: 200 OK', true, 200);
header('WWW-Authenticate: Basic realm="Access"', true, 401);
/* this would work: header('Status: 401 OK', true, 401); */




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-02 09:25 UTC] mike@php.net
-Type: Bug +Type: Documentation Problem
 [2013-10-02 09:25 UTC] mike@php.net
"Status:" is just a special CGI header and not handled by PHP at all.
 [2013-10-14 10:54 UTC] daverandom@php.net
-Status: Open +Status: Not a bug
 [2013-10-14 10:54 UTC] daverandom@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

Agreed with Mike.

Personally I don't think this is really a problem at all, not even a documentation problem, we do not need to document features that we do not support or have any influence over.

I'm closing this as expected behaviour, drop me a line if you disagree
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu May 01 23:01:29 2025 UTC