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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 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 type, regardless of the species, breed, flavor etc.

if !== evaluates to TRUE then === should also under the same conditions (all other things being equal)

if !== evaluates an integer 0 to TRUE, so should ===, it can't be true and still return a false value. The !== and === operators work differently, they should be complimentary.

Sorry if all this has inconvenienced anyone.
Ok, off-list because it will start to annoy people.

Your basic misunderstanding is that === is the opposite of !== which it's not.

As I've said in previous emails...

   (INTEGER === true) will always be false because the types don't match
   (INTEGER !== true) will always be true because the types don't match
   (INTEGER === false) will always be false because the types don't match
   (INTEGER === true) will always be false because the types don't match

The actual value of the INTEGER does not matter.

But the basic thing to get clear in your head is that === and !== are not opposites in the same way that == and != are.

Does that make it clearer?

-Stut


 OK I lied, that wasn't my last post , sorry.

*lightbulb*

Stut, thanks for your help, my thinking that !== and === are opposites is exactly the problem :)

I WAS thinking of them as being like != and ==.

the stick worked I think :)
I finally get it.

Thanks again.

Cheers,
Michael

-Stut

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux