Re: Back to Basics - Why Use Single Quotes?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 1, 2008 at 4:18 AM, Peter Ford <pete@xxxxxxxxxxxxx> wrote:
>
> Now *that's* a good reason... anything that means fewer \'s or \"s.
> I often go for HEREDOC syntax if the backslashes start taking over -
> readability is much more important to me than nanoseconds of performance.
>
> There's also the case where you might want literal $s in your string:
> e.g.
> $foo = 'You need to pay $dollars...';
>
> compared with
>
> $foo = "You need to pay \$dollars...";
>
> Again, it depends on you view of backslashes.
>
>
> --
> Peter Ford                              phone: 01580 893333
> Developer                               fax:   01580 893399
> Justcroft International Ltd., Staplehurst, Kent


You know, I'd use HEREDOC if I could have the closing line indented.
I always think it looks so goofy to have it on the first of a line
inside a method in a class.  When things get really weird I tend to
use (s)printf.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux