Bug #9518 [NEW]: Coding Standards should have no characters after ?>

From: Date: Fri, 01 Dec 2006 15:50:08 +0000
Subject: Bug #9518 [NEW]: Coding Standards should have no characters after ?>
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-8961@lists.php.net to get a copy of this message
From: michelo at rigadev dot com Operating system: Windows XP Package version: PHP version: 5.1.2 Package: Documentation Bug Type: Bug Bug description: Coding Standards should have no characters after ?> Description: ------------ The english manual page on Coding Standards file formats, http://pear.php.net/manual/en/standards.file.php, states "There should be one line feed after the closing PHP tag (?>). This means that when the cursor is at the very end of the file, it should be one line below the closing PHP tag." I believe this is incorrect as it can lead to problems if a class file is included before the html headers are sent. This should be rewritten to state that no characters should appear before the opening <?php or after the closing ?> including line feeds and other control characters. Thanks, Test script: --------------- ---- source1.php ---- <?php ?> ---- source1.php end ---- ---- source2.php ----- <?php require_once('source1.php') header("HTTP:/1.0 404 Not Found"); ?> Expected result: ---------------- Warning: Cannot modify header information - headers already sent by (output started at www.example.com/source1.php:4) in www.example.com/source2.php on line 3 -- Edit bug report at http://pear.php.net/bugs/bug.php?id=9518&edit=1 --

« previous php.pear.doc (#8961) next »