@devmount The single vs. double quotes myth is really just that, a myth. A misunderstanding. As long as there is no $ in the string it does not make any difference. Parsing must be done for both anyway because ' strings can contain \' and such. maettig.com/code/php/php-p…
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 ver 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.
And about the simple or double quotes? What your opinion about the performance of both?
Do you mean quotes? If you're interested, I could add a
'
vs"
test...Yes, quotes, my bad. Did you make some implementation of it?
Not yet, but I will create a test with the current PHP version and will come back when I have results 👍🏻
In the meantime, see this:
I did a quick benchmark, see this comment:
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 ver 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.
Great! Just for the convention is used so. Thanks, Andreas.
My pleasure 😊