PHP 4.0 Bug #4749: Newline output during initial code parsing
| From: | matthew at venux dot net | Date: | Thu, 01 Jun 2000 08:43:59 +0000 |
| Subject: | PHP 4.0 Bug #4749: Newline output during initial code parsing | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-19938@lists.php.net to get a copy of this message | ||
From: matthew@venux.net
Operating system: FreeBSD-4.0-Release
PHP version: 4.0.0 Release
PHP Bug Type: Scripting Engine problem
Bug description: Newline output during initial code parsing
In PHP3 the following line was fine:
$oSomeObject->
someFunction();
But in PHP4.0.0 you have to do the following:
$oSomeObject->\
someFunction();
No big deal except that without the backslash the very act of the .php file simply being parsed
produces a newline to be output to the client browser (before headers, etc.)
Try this with 4.0.0
---------
index.php
<?php
require("myclass.req");
?>
<HTML>
<HEAD><TITLE>Test</TITLE>
</HEAD>
<BODY>
Test
</BODY>
</HTML>
-----------
myclass.req
<?php
Class MyClass {
function myFunc1(){
return;
}
function myFunc2(){
$this->
myFunc1();
}
}
?>
Pull up the index.php and view the source. You will see one blank line before the <HTML> tag.
Now add a backslash after the arrow operator in myFunc2 and the line goes away.
Matthew