Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Oct 092009

Should I always use single-quotes for PHP strings?


Some people say single-quotes string is faster than double-quotes string in PHP. But this have been rejected by the PHP's developer

Benchmarks run against PHP 5.2 and 5.3 show that parsing double-quoted 
strings with interpolation is no slower (and often faster) than single- 
quoted strings using concatenation. When simple strings with no 
variables in them are used, the performance is clearly better with 
double-quoted strings due to implementation details in the engine. See 
the benchmark posted at . 


 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>