Re: Back to Basics - Why Use Single Quotes?

From: Date: Fri, 01 Aug 2008 19:36:56 +0000
Subject: Re: Back to Basics - Why Use Single Quotes?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-277596@lists.php.net to get a copy of this message
On Fri, Aug 1, 2008 at 4:18 AM, Peter Ford <pete@justcroft.com> 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.

« previous php.general (#277596) next »