|
Posted by "Daevid Vincent" on 07/10/05 00:47
I don't think so.
The "&& false" guarantees the code in the 'if' portion will never execute.
It's effectively commenting it out. I agree it was probably left over
'debug' code.
The "if( !isset( $_SESSION['PrevUrl'] ) )" has a very good chance of being
true. ANDing with boolean false NEVER has a chance of being true.
> -----Original Message-----
> From: André Medeiros [mailto:andre.caum@gmail.com]
> Sent: Saturday, July 09, 2005 9:19 AM
> To: Marco Tabini
> Cc: Sam Smith; php
> Subject: Re: [PHP] if(true && false) //??
>
> That's the same as having
>
> if( !isset( $_SESSION['PrevUrl'] ) ) {
> //do something here
> }
>
> On 7/9/05, Marco Tabini <marcot@tabini.ca> wrote:
> > It can't -- that looks like some leftover debugging code to me.
> >
> >
> > Marco
> >
> >
> > On 7/9/05 10:50 AM, "Sam Smith" <php@itab.com> wrote:
> >
> > >
> > > I have some code that I barrowed that works but I don't
> get how it could
> > > possible work, obviously I don't understand how "false" works:
> > >
> > > How can this ever pass?:
> > > if (isset($_SESSION['PrevUrl']) && false) {
> > > ....
> > >
> > >
> > > Thanks
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Navigation:
[Reply to this message]
|