Re: Back to Basics - Why Use Single Quotes?

From: Date: Fri, 01 Aug 2008 19:41:08 +0000
Subject: Re: Back to Basics - Why Use Single Quotes?
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-277597@lists.php.net to get a copy of this message
On Fri, 2008-08-01 at 15:36 -0400, Eric Butera wrote: > 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. > > > 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. *lol* Yeah, I hate how HEREDOC ruins my nice formatting too. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP

« previous php.general (#277597) next »