Reply to Re: [PHP] Re: use of curly braces with string interpolation.

Your name:

Reply:


Posted by Jochem Maas on 10/04/46 11:05

M. Sokolewicz wrote:
> Jochem Maas wrote:
>

....

>> I always use curly braces around vars placed in double quoted strings,
>> I do this for 2 reasons:
>>
>> 1. I believe It helps the engine because the var delimitation is
>> explicit, and this means the interpolation is (should be?) faster.

consider that belief destroyed!

>
> it's just as fast as not using it. The delimiter with variables is
> simply the $[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]* part. Simple
> variables (scalar) are described using the above, it doesn't make it
> faster to put more around em. Adding {} around array's/objects shouldn't
> make it faster, since it's still just taking the entire thing as a
> variable until it comes acress a character that either delimits the
> whole thing, or is simply not allowed there.

ok, thanks for the insight!

>
>> 2. it looks nice (easier to read!)
>
> I think it looks ugly... but it's a simple matter of personal taste ;)

hihi :) (touché)
actually one of the reasons I find it easier to read is that (some of)
my texteditor highlight curly-brace-delimited strings. secondly I seem
to have trained myself to scan for the curlies.

[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

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