I think I might have found a bug in PHP!
Put this code into a PHP file, then go to the page in a web browser and do a View Source.
<? $test1 = "hello"; $test2 = "world"; ?>
<h1><?=$test1?>
<?=$test2?></h1>
It SHOULD output 'hello' and 'world' on separate lines, thereby adding space between them in the H1 when you do a View Source. But for me, whenever I end a line with a <?=...?>, it eats the linebreak and sticks the two words together with no space between them.
If I add any single character at the end of the second line, that causes the linebreak to reappear in the output.
I'm using PHP 4.3.4 on Mac OS X. Can y'all try it on your PHP installations? Is anyone here into PHP development, have you seen this reported before?
Here's a simpler test case. This sticks the words together on the same line in the HTML source:
<?="hello"?>
<?="world"?>
This puts them onto separate lines in the source, and space between them in a browser:
<?="hello"?>x
<?="world"?>
Edit: I revised this journal entry to make it a little more clear. Don't reply before you read the discussion below; it's already been hashed out. Note that I'm talking about the output of the PHP script, NOT how a web browser renders it.
Put this code into a PHP file, then go to the page in a web browser and do a View Source.
<? $test1 = "hello"; $test2 = "world"; ?>
<h1><?=$test1?>
<?=$test2?></h1>
It SHOULD output 'hello' and 'world' on separate lines, thereby adding space between them in the H1 when you do a View Source. But for me, whenever I end a line with a <?=...?>, it eats the linebreak and sticks the two words together with no space between them.
If I add any single character at the end of the second line, that causes the linebreak to reappear in the output.
I'm using PHP 4.3.4 on Mac OS X. Can y'all try it on your PHP installations? Is anyone here into PHP development, have you seen this reported before?
Here's a simpler test case. This sticks the words together on the same line in the HTML source:
<?="hello"?>
<?="world"?>
This puts them onto separate lines in the source, and space between them in a browser:
<?="hello"?>x
<?="world"?>
Edit: I revised this journal entry to make it a little more clear. Don't reply before you read the discussion below; it's already been hashed out. Note that I'm talking about the output of the PHP script, NOT how a web browser renders it.
