You are here: RE: [PHP] if(true && false) //?? « PHP « IT news, forums, messages
RE: [PHP] if(true && false) //??

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]


Удаленная работа для программистов  •  Как заработать на 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

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