|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41952 Problem with PHP6 and Byte Order Mark
Submitted: 2007-07-10 17:02 UTC Modified: 2007-07-11 08:34 UTC
From: hedvall at gmail dot com Assigned:
Status: Not a bug Package: Compile Warning
PHP Version: 6CVS-2007-07-10 (snap) OS: Win2k SP4
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: hedvall at gmail dot com
New email:
PHP Version: OS:


 [2007-07-10 17:02 UTC] hedvall at gmail dot com
After upgrading to the latest PHP6 build from 6CVS-2007-06-21 the compiler no longer accepts the UTF-8 BOM (Byte Order Mark) to be sent before the headers. It might be correct to not send the headers after any other output but it hasn't caused any trouble with any newer browser on any platform (win, mac, linux).
I always remove the BOM before the sites go live but when developing it's easier to leave it there until the page is finished.
This is not a duplicate of 22108.

Reproduce code:
header("HTTP/1.0 404 Not Found");

Expected result:
404 header sent without warning

Actual result:
Warning: Cannot modify header information - headers already sent by (output started at [...]/header.php:1) in [...]/header.php on line 2


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-07-11 07:27 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

 [2007-07-11 08:34 UTC] hedvall at gmail dot com
Alright, this might not be a bug, but it worked in older versions and the one of the comments on bug said that the BOM won't be sent at all with PHP6 along with the Unicode support. But yes, the documentation says that no header can't be sent after any output, but this did work previously because most browsers ignore the BOM completely, even if it's sent in the middle of the header block.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sun Oct 01 22:01:24 2023 UTC