Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is faster in PHP, single or double quotes? [duplicate]

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?

like image 575
cornernote Avatar asked Feb 02 '11 05:02

cornernote


1 Answers

I would say that single quotes are faster because they don't require Shift ;)

The different quotes have implications on variable output and escape characters. Content inside single quotes is taken as is, no escape characters and variables are interpreted. Double quotes interpret variable values and escape special characters like newlines (\n).

like image 197
jondavidjohn Avatar answered Oct 08 '22 05:10

jondavidjohn