note 41186 deleted from function.echo by aidan

From: Date: Sun, 27 Jun 2004 13:57:34 +0000
Subject: note 41186 deleted from function.echo by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-71905@lists.php.net to get a copy of this message
Note Submitter: george@geteducation.com ---- Using Single quotes Vs. Double quotes with echo When we need variable interpolation (substitute the variable with its value) inside a string the choice of double quotes is obvious over single quotes. But when there is no varibale interpolation involved, the choice between Single quotes and Double quotes is influenced by: A. Performance issues in using single quotes vs double quotes It might seem that single quote are faster then double quotes since php does not need to parse the string inside the single quotes to do variable interpolation. But benchmarks available at http://www.geteducation.com/enhdocs/php/echo-benchmark.html show that there is no difference at all. (if you would like to see other examples in the benchmark send me a email and i will put them there) Please note that these benchmarks are running on php version > 4.3. There were some lexer changes in php 4.3 which eqaulized these differences B. formatting charecters are not translated in single quotes hence \n inside single quotes wont give you a new line

« previous php.notes (#71905) next »