You are here: Re: Very Weird Behavior « PHP Programming Language « IT news, forums, messages
Re: Very Weird Behavior

Posted by Ian B on 11/28/05 14:24

Alan Little wrote:
>
> Perhaps, but it has no bearing on the issue. That is, if I used isset()
> instead, perhaps it wouldn't tickle this particular bug, but it is in
> fact a bug. Which reminds me, I should report it.

It's not a bug, it's illegal code. You can't terminate a line with a
dot, and you can't concatenate an if statement into a string. It
produces a parse error and stops execution. If you don't get an error
message it is because of your settings. It is still an error, though.

>
> > What do you expect from if($varname) ?
>
> I expect PHP to tell me if it has a problem. While if ($var) may not be
> ideal coding practice, it is legal.
>

Legal, yes. Useful in this situation, no. What you are saying in effect
is "if the website name can be converted to a non-zero number, then..."

I don't mean to give offence, but you should consider coding like other
people do, at least until you understand the consequences of not doing
so.

Ian

 

Navigation:

[Reply to this 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

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