Possible Duplicate:
Is there a performance benefit single quote vs double quote in php?
Which is faster, single or double quotes and why?
Also, what is the advantage of using either method?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Depends what you want to do. I just did some benchmarks and tested string assignment with a 5 test cases: double quotes + variable, double quotes, double quotes and string append, single quotes, and single quotes with string append.
My test code. A million loops. String assignment.
Results:
Single and Double quotes strings without variables are equally as fast. (each echoed around .08).
Single and Double quote string with variable concatenation are about the same, but slower than no variable. (each echoed around .17-.20)
Double quotes with a variable in the string was slowest (around .20-.25)
So Single/Double doesn’t really matter, but it seems string concatenation is faster than variable replacement.