ID:               28381
 User updated by:  mikemc-phpbug2 at contactdesigns dot com
 Reported By:      mikemc-phpbug2 at contactdesigns dot com
 Status:           Open
 Bug Type:         Scripting Engine problem
 Operating System: Linux 2.4.20-28.9smp
 PHP Version:      4.3.6
 New Comment:

Almost forgot the workaround!  You can insert a space right after "?>"
and the newline gets output.

Yes it is specific to newlines for example, this:

<?= $_SERVER['PHP_SELF'] ?>*
I should be on a new line - but I am not!

Outputs this:

testing.php*
I should be on a new line - but I am not!

So PHP only seems to eat the newline - it ignores the "*".  Wonder if
there are any other characters it doesn't like?


Previous Comments:
------------------------------------------------------------------------

[2004-05-13 05:44:52] mikemc-phpbug2 at contactdesigns dot com

Description:
------------
This isn't a major bug, but I would think it should be classified as a
bug just so that it is on the radar screen.  For those of us too lazy
to write <?php echo $variable ?> and instead prefer <?= $variable ?>,
if a newline immediately follows the "?>" then PHP eats the new line
:-(

Reproduce code:
---------------
vi test.php (then insert following code and :wq Enter)
<?= $_SERVER['PHP_SELF'] ?>
I should be on a new line - but I am not!
[shellprompt]# php test.php
testing.phpI should be on a new line - but I am not!


Expected result:
----------------
testing.php
I should be on a new line - but I am not!

Actual result:
--------------
testing.phpI should be on a new line - but I am not!


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=28381&edit=1

Reply via email to