RE: [PHP] odd behavior of stripos() with === operator *LAST POST*

2006-11-17 Thread Ford, Mike
On 17 November 2006 16:50, Stut wrote: > > > Your basic misunderstanding is that === is the opposite of !== > > > which it's not. Complete rubbish -- it so absolutely is! If $a===$b, then !($a===$b) is the same as $a!==$b, QED. > > >(INTEGER === true) will always be false because the type

Re: [PHP] odd behavior of stripos() with === operator *LAST POST*

2006-11-17 Thread Stut
Ok, just to shut you all up, I managed to convince the OP earlier today, but it never made it to the list... Michael wrote: At 02:58 AM 11/17/2006 , Stut wrote: Michael wrote: This will be my last post on this thread of discussion. Thanks to all who replied, I have it figured out. I

Re: [PHP] odd behavior of stripos() with === operator *LAST POST*

2006-11-17 Thread tedd
At 2:54 AM -0700 11/17/06, Michael wrote: Logic dictates that if something evaluates to NOT FALSE it must be TRUE. Regardless of the type, regardless of the species, breed, flavor etc. Not true -- it depends upon your reference/environment. For example, NULL is neither true nor false in MySQL.

Re: [PHP] odd behavior of stripos() with === operator *LAST POST*

2006-11-17 Thread Jochem Maas
Robert Cummings wrote: > On Fri, 2006-11-17 at 17:29 +0100, Jochem Maas wrote: >> Robert Cummings wrote: >>> On Fri, 2006-11-17 at 02:54 -0700, Michael wrote: This will be my last post on this thread of discussion. Thanks to all who replied, I have it figured out. I guess m

Re: [PHP] odd behavior of stripos() with === operator *LAST POST*

2006-11-17 Thread Robert Cummings
On Fri, 2006-11-17 at 17:29 +0100, Jochem Maas wrote: > Robert Cummings wrote: > > On Fri, 2006-11-17 at 02:54 -0700, Michael wrote: > >> This will be my last post on this thread of discussion. > >> > >> Thanks to all who replied, I have it figured out. > >> > >> I guess my only problem with the wa

Re: [PHP] odd behavior of stripos() with === operator *LAST POST*

2006-11-17 Thread Jochem Maas
Robert Cummings wrote: > On Fri, 2006-11-17 at 02:54 -0700, Michael wrote: >> This will be my last post on this thread of discussion. >> >> Thanks to all who replied, I have it figured out. >> >> I guess my only problem with the way the !== and === operators work in this >> situation is this: >> >

Re: [PHP] odd behavior of stripos() with === operator *LAST POST*

2006-11-17 Thread Robert Cummings
On Fri, 2006-11-17 at 02:54 -0700, Michael wrote: > This will be my last post on this thread of discussion. > > Thanks to all who replied, I have it figured out. > > I guess my only problem with the way the !== and === operators work in this > situation is this: > > Logic dictates that if somet

RE: [PHP] odd behavior of stripos() with === operator *LAST POST*

2006-11-17 Thread Brad Fuller
iday, November 17, 2006 7:15 AM > To: Michael > Cc: php-general@lists.php.net > Subject: RE: [PHP] odd behavior of stripos() with === operator *LAST POST* > > On 17 November 2006 09:55, Michael wrote: > > > This will be my last post on this thread of discussion. > > &g

RE: [PHP] odd behavior of stripos() with === operator *LAST POST*

2006-11-17 Thread Ford, Mike
On 17 November 2006 09:55, Michael wrote: > This will be my last post on this thread of discussion. > > Thanks to all who replied, I have it figured out. > > I guess my only problem with the way the !== and === > operators work in this situation is this: > > Logic dictates that if something eva

Re: [PHP] odd behavior of stripos() with === operator *LAST POST*

2006-11-17 Thread Michael
This will be my last post on this thread of discussion. Thanks to all who replied, I have it figured out. I guess my only problem with the way the !== and === operators work in this situation is this: Logic dictates that if something evaluates to NOT FALSE it must be TRUE. Regardless of the typ

Re: [PHP] odd behavior of stripos() with === operator

2006-11-17 Thread Stut
Michael wrote: I understand that the integer 0 and FALSE are different and I read the manual so many times my head hurts, heh. There are a few ways to work around this, probably more than I know. (according to the documentation for strrpos() you could test the return from stripos() for is_bool

Re: [PHP] odd behavior of stripos() with === operator *UPDATE*

2006-11-17 Thread Stut
Please include the list in replies. Michael wrote: Why can't === realize that integer 0 means TRUE? whereas "" or a BOOLEAN false does not? === evaluates integer 0 to FALSE :( the !== operator recognizes the difference. "(integer) 0 !== FALSE" is TRUE yet "(integer) 0 === TRUE" is FALSE, bu

Re: [PHP] odd behavior of stripos() with === operator

2006-11-17 Thread Michael
At 02:33 AM 11/17/2006 , Stut wrote: >Michael wrote: >> I understand that the integer 0 and FALSE are different and I read the >> manual so many times my head hurts, heh. >> >> There are a few ways to work around this, probably more than I know. >> (according to the documentation for strrpos() yo

Re: [PHP] odd behavior of stripos() with === operator

2006-11-17 Thread Michael
At 02:10 AM 11/17/2006 , Stut wrote: >Michael wrote: >> Ok, picking gnits... >> I should have said NOT true and NOT false at the same time. >> As for the return of the integer 0.. >> The documentation indicates that the === and !== operators take this into >> account in fact there is a specific ex

Re: [PHP] odd behavior of stripos() with === operator *UPDATE*

2006-11-17 Thread Stut
Michael wrote: I'm not sure why the === operator does not handle this condition, since the wonderful people at PHP foresaw the problem and fixed !== to handle it, I would like to see the === fixed to handle this as well (if it is even possible, not sure about how this is implemented??) Th

Re: [PHP] odd behavior of stripos() with === operator

2006-11-17 Thread Stut
Michael wrote: Ok, picking gnits... I should have said NOT true and NOT false at the same time. As for the return of the integer 0.. The documentation indicates that the === and !== operators take this into account in fact there is a specific example in the manual. My point here is that if !==

Re: [PHP] odd behavior of stripos() with === operator *UPDATE*

2006-11-17 Thread Michael
At 12:24 AM 11/17/2006 , Michael wrote: >HEllo all, > >After pulling my hair out for several hours trying to figure out why my code >wasn't working I built this little test and ran it, the results are interesting >in the least, and to me, surprising. It is possible that I have done something >wrong

Re: [PHP] odd behavior of stripos() with === operator

2006-11-16 Thread Michael
At 12:29 AM 11/17/2006 , you wrote: >> I have underlined the output I am interested in... > >You did??? Where? > Ok, my bad, I sent the mail as plain text instead of styled :P oops >> How can the variable $found be both TRUE and FALSE at the same time? > >None of your output above indicates that

Re: [PHP] odd behavior of stripos() with === operator

2006-11-16 Thread Robert Cummings
On Fri, 2006-11-17 at 00:24 -0700, Michael wrote: > HEllo all, > > After pulling my hair out for several hours trying to figure out why my code > wasn't working I built this little test and ran it, the results are > interesting > in the least, and to me, surprising. It is possible that I have don

[PHP] odd behavior of stripos() with === operator

2006-11-16 Thread Michael
HEllo all, After pulling my hair out for several hours trying to figure out why my code wasn't working I built this little test and ran it, the results are interesting in the least, and to me, surprising. It is possible that I have done something wrong, but I checked and rechecked this in the docu