go to bug id or search bugs for
From the documentation:
There are two special-case header calls. The first is a header that starts with the string "HTTP/" (case is not significant), which will be used to figure out the HTTP status code to send.
The optional replace parameter indicates whether the header should replace a previous similar header, or add a second header of the same type. By default it will replace [...]
But as can be seen below, header fails to replace headers in all cases.
As can be seen in the code linked above, header only truly replaces a similar header in the case if the Status is 200, for every other status code (that I've tested) PHP will output a duplicate header which does not conform to CGI spec.
Add a Patch
Add a Pull Request
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.