I’m talking about the performance increase here. From all I know you can echo variables in double quotes ("), like so:
<?php
echo "You are $yourAge years old";
?>
But single quotes will just return You are $yourAge years old. But what about performance differences? I’ve always gone by the rule that single quotes are faster because the PHP interpreter doesn’t have to search through the string for variables. But I’m seeing more and more blog and forum posts on the web saying differently.
Does anyone actually have any information on this subject? Perhaps benchmark tests or something?
According to the PHP Benchmark, the difference is extremely negligible:
Even if the differences were a multiple of what they are, they would not be relevant for real-life performance IMO. Database and file operations will take dozens, if not hundreds of times more time. That’s not to say your question isn’t totally valid, but it’s not a big deal when optimizing your code.
Readability is much, much more important.