|
Posted by Andy Jeffries on 07/17/07 08:59
On Mon, 16 Jul 2007 10:01:50 +0200, Markus wrote:
> I partially agree. Anyway I see nothing Gänsehaut-prone about
> concatenating single-quoted strings, such as
>
> print 'text '.$var.' more text '.$arr['foo'].' '.$obj->bar.'st time';
>
> It is IMO a good habit if somebody does not want to run into the
> questions discussed above, and there seem to be even performance reasons
> for it:
Assuming it is slower to use variables within strings/double quotes* -
it comes down to the argument of developer time/cost versus server/CPU
cycles cost.
Personally I find double quotes with embedded variables to be MUCH more
readable and therefore a 0.1 second difference over a million prints is
negligible (particularly in comparison to the delay while waiting for the
DB servers to respond).
* The next comment after the one you linked suggests that it's faster to
do string interpolation than concatenation with either single or double
quotes:
http://www.php.net/manual/en/language.types.string.php#74257
Cheers,
Andy
Navigation:
[Reply to this message]
|