[sf-perl] PHP line-ending question

David Fetter david at fetter.org
Sun Mar 5 08:17:21 PST 2006


On Sat, Mar 04, 2006 at 11:48:31PM -0800, Rich Morin wrote:
> I have some PHP code that looks like this:
> 
>    <? $a = 'some text';
>       $b = 'more text.';
>    ?>
> 
>    This is <?= $a ?>.
>    This is <?= $b ?>
>    That's enough...
> 
> I would expect the output to look like this:
> 
>    This is some text.
>    This is more text.
>    That's enough...
> 
> Instead, it looks like this:
> 
>    This is some text.
>    This is more text.   That's enough...

I tried to reproduce this at <http://fetter.org/~shackle/foo.php> and
got something different, i.e. all on the same line.  Could you post an
self-contained PHP file that reproduces the problem as you see it?

> 
> FYI:
> 
>   % php -v
>   PHP 4.4.1 (cli) (built: Feb  7 2006 06:26:45)
>   ...
> 
> Is this a bug or a feature?

Yes ;)

<a href="http://tnx.nl/php">PHP is training wheels without the bike.</a>

Cheers,
D
-- 
David Fetter david at fetter.org http://fetter.org/
phone: +1 415 235 3778

Remember to vote!


More information about the SanFrancisco-pm mailing list