Welcome Guest, Not a member yet? Register   Sign In
PHP double quotes versus single quotes
#3

[eluser]Nick Husher[/eluser]
Quote:2) "Use single-quotes for strings."
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 <http://pastie.org/523023>.
...
4) "Don't use concatenation with echo."
This is exactly the opposite of correct advice. The engine handles
multiple arguments to echo() in such a way that concatenation (or
double-quoted string interpolation) is actually much faster. See the
benchmark posted at <http://pastie.org/523020>.

From Gwynne Raskind, a PHP language developer. [source]


Messages In This Thread
PHP double quotes versus single quotes - by El Forum - 08-11-2009, 03:50 PM
PHP double quotes versus single quotes - by El Forum - 08-11-2009, 04:15 PM
PHP double quotes versus single quotes - by El Forum - 08-11-2009, 04:47 PM
PHP double quotes versus single quotes - by El Forum - 08-11-2009, 06:23 PM
PHP double quotes versus single quotes - by El Forum - 08-11-2009, 06:49 PM
PHP double quotes versus single quotes - by El Forum - 08-11-2009, 07:40 PM
PHP double quotes versus single quotes - by El Forum - 08-12-2009, 05:45 AM
PHP double quotes versus single quotes - by El Forum - 08-12-2009, 06:15 AM
PHP double quotes versus single quotes - by El Forum - 08-12-2009, 10:41 AM
PHP double quotes versus single quotes - by El Forum - 08-12-2009, 11:19 AM
PHP double quotes versus single quotes - by El Forum - 08-12-2009, 11:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB