DEV Community

Discussion on: 4 PHP Tricks to Boost Script Performance

Collapse
 
devmount profile image
Andreas • Edited

I can confirm that the single vs. double quotes myth is really just a myth. At least for the PHP 7.2+ (maybe this originates from very early PHP versions). I did a quick benchmark:

You can say with caution, that in average, double quotes are slightly (and I really mean very slightly!) faster than single quotes. We're talking about a max of 2ms on 5 million iterations... Obviously only, if no variable is replaced.