Re:PHP Team Responds to Google's PHP Tips
by chaosmachine on Saturday June 27, 2009 @11:17AM
(#676909)
If I was going to guess, I'd say that double quoted strings are passed to a different "engine" than the single quotes, and perhaps over time the double quote engine has received better optimization.
[ Parent
| on HN ]
Re:PHP Team Responds to Google's PHP Tips
by statictype on Saturday June 27, 2009 @12:11PM
(#676940)
Yeah, thats what I also figured but, really, how much can you optimize a constant string literal (which I'm given to understand the single-quote thing is)?
Must be some kind of caching optimization and not really something that saves CPU cycles
Single quotes aren't a constant string literal, because they have to parse \'.
Guesstimate: if someone cares about performance, they should have already installed an opcode cache, which probably wouldn't have to re-parse constant strings.
But then thinking: you'd expect constant double quoted strings to also get this treatment, so single quoting still gets you nothing.
All the above is void without benchmarks.