From: ian at ianhobson dot co dot uk Operating system: windows 2000 PHP version: 5.2.8 PHP Bug Type: *General Issues Bug description: include inside include generates junk output
Description: ------------ include-ing a file that includes another file before producing any output, results in a few invalid characters being emitted before the <DOCTYPE> line Reproduce code: --------------- Create a file with any trivial content. Include, require or require_once it from a second file. This second file needs the php tags and the include line only. Include this second file in a page like this (which is valid). <?php // test0.php require_once "test1.php"; ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html><head> <title>Test Demo Page</title> </head><body> <p>This page has junk before the doctype</p> </body></html> Expected result: ---------------- The source should start with the "<" of the doctype line as its first character. Actual result: -------------- In iIE source, you will see 6 squares before the <!DOC... In Firefox validator it will complain about invalid characters in the prolog. If you move the content of the inner file up a level, all works correctly. -- Edit bug report at http://bugs.php.net/?id=46998&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46998&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46998&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46998&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=46998&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46998&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=46998&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=46998&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=46998&r=needscript Try newer version: http://bugs.php.net/fix.php?id=46998&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=46998&r=support Expected behavior: http://bugs.php.net/fix.php?id=46998&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=46998&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=46998&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=46998&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46998&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=46998&r=dst IIS Stability: http://bugs.php.net/fix.php?id=46998&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=46998&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=46998&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=46998&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=46998&r=mysqlcfg