A web site, 5 human years in code (5 developers, approx one year), 10 of thousands of hits every day. Is it really going to have an impact if we change all " to ' where possible?
No.
As somebody pointed out in a PHP micro-optimization question a few weeks back (I think the issue was the same ' versus "), implementing the optimization will almost always cost more time than would ever be saved by it.
See the double (") vs. single (') quotes section at PHPBench (scroll to the end of the page). When I invoked the page, I saw the following results:
Single Quotes: 257 µs
Double Quotes: 232 µs
Unless 25µs makes a difference for your problem domain, it doesn't matter.
I'm going to try to work out the math here, someone correct me if I make a mistake. Let's say that you have 10,000 places where you used double quotes instead of single quotes at a 25µs difference per page load (who knows if it actually will work out that way, you need to benchmark your actual code) that would be a would be a 0.25 second difference in execution time. That could be significant depending on server-load if you were Facebook. However, I suspect that there are many other places in your codebase that are far more resource intensive that you will want to optimize before you even look at quotes. Just look at the pain points highlighed on the PhpBench page and you will see that you should have different priorities. Also, these numbers will be drastically different if you run a different php implementation like Quercus - which can solve some performance bottlenecks.
Yes, you'll end up making that one mistake where you change "$test\n"
to '$test\n'
.
Real-numbers-wise, no.
The risk of spending time on a micro-optimiztion attempt is that there are probably (yet to be identified) aspects of the code (and any third-party dependencies) which could/should be profiled, then refactored/optimized with a much better efficiency-increase per man-hours-spent ratio.
I can't recommend enough that you read Remember also the rules of Optimization Club.
There is no difference in peformance at run time. But there is a difference at compile time.
The usual way of thinking about quotes in PHP is:
Variables inside single-quoted strings are not parsed, and so the PHP engine doesn't have to waste time looking for them. Hence, single-quoted strings must be more efficient
That assumption is false because the PHP engine doesn't perform that ckeck at run time, but at compile time.
When PHP is parsing your script, if it finds a double-quoted string that has no variables inside it, then that string is treated as a constant string, i.e. its value won't change in the entire script's life-time (if there are variables inside, then it's converted to string concatenations).
Likewise, if PHP finds a single-quoted string, it is treated as a constant as well. But in this case PHP doesn't have to parse the content of the string lookng for variables.
So the answer to your questions depends on whether you are using a PHP caching solution or not (APC, eAcceleator, etc...). If the compilations of your scripts are not being cached then you might have a slight performance improvement because your scripts are compiled every time a visitor loads a page, and hence compilation time is important. But if the compilations of your scripts are cached, then there is no different on using single- vs double-quoted strings.