|
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
[Back to original message]
|