cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: Quotes: Single, double, and NONE

From: Richard Lynch <ceo_at_l-i-e.com>
Date: Tue, 1 Jan 2008 17:51:54 -0600 (CST)

On Sat, October 27, 2007 9:40 am, Colleen R. Dick wrote:

I realize I'm WAY behind, but...

> People:
> Back to PHP basics: PHP is flawed but not *THAT* flawed.
> (apologies to most of you who know this) here is how it rolls.
> Double quotes and single treat embedded variables differently.
> "foo" and 'foo' happen to be the same because
> there is no variable in it. For this reason single quotes are more
> efficient.

Single-quotes are not significantly more efficient than double quotes.

Note that single-quotes STILL have some special characters:
\'
\\
So the parser has to iterate over each character with a 1-char
look-ahead (or look-behind) to know what to do.

Double-quotes has a slightly larger 'switch' statement for what to
*DO* with the special characters, but that's not a significant time
savings.

The "single-quotes is faster" answer is essentially an urban legend. :-)

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-01-02