Reply to Re: newbie syntax question

Your name:

Reply:


Posted by rlee0001 on 02/13/06 01:45

Sorry, my response wasn't very clear. Your code was:

print '12 == 12 : ' . print 12 == 12;

As you can see, you are passing a call to print to another call to
print. That is -- you are passing print to print. If you remove the
second print like so:

print '12 == 12 : ' .12 == 12;

The problem might go away but you run the risk of having all kinds of
"order of operations" issues. So as a general rule, I always put
brackets around equations used with the dot operator like so:

print '12 == 12 : ' .(12 == 12);

As you said: the brackets may be redundant (and probably are) but I do
this out of habbit now because I have been bit my this before and
debugging order of operations bugs can be a pain. In any case I think
the habbit is a good one anyways.

-Robert

[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

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