4 ms·
The bad performance of count() and the lack of difference in performance between single and double quotes came as a surprise!
by Maxious 14y ago
The bad performance of count() and the lack of difference in performance between single and double quotes came as a surprise!
- codeka 14y agoIf I were writing a PHP parser, then I would convert double-quoted strings of the form "foo $bar baz" to 'foo '.$bar.' baz' when the script is first parsed. So executing the string concatenation in a loop would have no performance difference, because the string is only parsed the first time. That's just a guess, though, having not actually looked at the code myself.