php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #55436 Bad Examples on header()
Submitted: 2011-08-16 22:45 UTC Modified: 2011-08-17 11:07 UTC
From: scotepi at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.3.6 OS: Linux
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: scotepi at gmail dot com
New email:
PHP Version: OS:

 

 [2011-08-16 22:45 UTC] scotepi at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.header%23Parameters
---

The example for a 404 header assumes you are using http/1.0 it should be 
header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found") also, for the 404 example and  
the location example should at lest show you how to use the http_response_code 
maybe in a example #3

Test script:
---------------
<?php

header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found", null, 404);


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-17 11:07 UTC] bjori@php.net
-Status: Open +Status: Bogus
 [2011-08-17 11:07 UTC] bjori@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

http_response_code is linked from the seealso, and SERVER_PROTOCOL is not 101% 
guaranteed to be available.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 12:00:01 2026 UTC