php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #35133 Strange extra characters appears on page
Submitted: 2005-11-07 00:52 UTC Modified: 2005-11-07 00:58 UTC
From: sverker at fridqvist dot se Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.0.5 OS: Linux lhotse 2.6.12-1-386
Private report: No CVE-ID: None
 [2005-11-07 00:52 UTC] sverker at fridqvist dot se
Description:
------------
Three extra characters () are inserted at the top of my 
page. If I start the main page with ob_end_clean() these 
characters do not appear.

It seems to me that a bug causes PHP to generate and send 
the extra characters to Apache. The characters certainly 
have not been coded by me.

I have not been able to generate the problem through other 
PHP code.

The page is generated by PHP5 code distributed on > 10 
classes in individual files that are required as needed 
through __autoload().

The HTML is generated using DOMImplementation, and output in 
one of the required files through this code:

header('Content-Type: text/html; charset=iso-8859-1');
echo $doc->saveXML();

This is the one single echo statement in the code.


Reproduce code:
---------------
I am reluctant to expose the complete code, since it would reveal connection info for my database that I prefer to keep for myself, and the code will not work without the DB anyway.

If you are interested in following up this, I am willing to do some experiments to reproduce the error with other code.

Expected result:
----------------
I expect the page to look this way:

http://sverker.fridqvist.se/test/index.php5


Actual result:
--------------
Without the ob_end_clean() at the top of the code the page 
will contain the extra characters:

http://sverker.fridqvist.se/test/indexError.php5

The extra characters are visible with Mac OS X browser Camino 
0.9a1, but not with Safari and Opera. The W3C validator 
reports the characters as an error.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-11-07 00:58 UTC] derick@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

This is a "BOM" - a few bytes that mark an file as UTF8. Fix your editors' configuration not to add the BOM.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Dec 06 23:00:01 2025 UTC