Reply to Re: single quotes, double quotes and "undefined index"

Your name:

Reply:


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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация