After coding in C and C++ for such a long time , it really takes some effort to keep in mind that there is a quite a big difference as how strings are evaluated in languages such as PHP or javascript when enclosed in double quotes as compared to single quotes. Proper use can definitely help in performance wise.
I think its safe to say the general rule of thumb when it comes to deciding when to use what is use single quotes when outputting plain strings and html with no variables since the PHP parser wont have to look for variable, and use double quotes when there are variables, special characters, symbols .
Here is a nice PHP benchmarking site http://www.blueshoes.org/phpBench.php
No comments:
Post a Comment