[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-general
Subject:    Re: [PEAR] PHP_Beautifier via the command line
From:       "Chuck Burgess" <demon.gene () gmail ! com>
Date:       2008-03-31 22:01:15
Message-ID: 1d0338290803311501wd1b17cfw228e0be50584f32a () mail ! gmail ! com
[Download RAW message or body]


On Mon, Mar 31, 2008 at 4:57 PM, Thomas Anderson <zelnaga@gmail.com> wrote:

> How would I do that?  My PHP_EOL is "\r\n".
>
> I assume Linux's PHP_EOL would be "\n"?  If so, then  that'd be one
> situation where you wouldn't want to use PHP_EOL.  Your employer uses CVS
> or
> SVN or whatever and they use "\r\n" as the end line character(s), whereas
> you run Linux on your laptop, and you don't.
>

The point of using the PHP_EOL constant is that your PHP installation will
choose for you which one is used.  When you copy your PHP code from Linux,
where it ran with PHP using "\n" for its value, over to Windows, the PHP
executable there will instead use "\r\n" when it reads PHP_EOL.  The whole
point of the PHP constant is so that you, in your PHP code, never have to
write either line ending nor worry about what OS the code will run on,
because PHP will use the correct line ending at runtime when it reads the
PHP_EOL constant in your code.

-- 
CRB


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic