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

From: Date: Fri, 17 Nov 2006 09:22:35 +0000
Subject: Re: odd behavior of stripos() with === operator *UPDATE*
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-244777@lists.php.net to get a copy of this message
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??)
This would not be a 'fix', this would be a break. Since !== and === are checking type *and* value, the logical truth of one does not necessarily mean the other will be false. Once you understand that it should all become clear.
If anyone sees anything I did wrong that is causing this behavior PLEASE let me know, I am no PHP "Guru" and I have no ego, and will humbly retract this post if I am wrong. I would just like to know WHY and WHERE I am wrong :)=
You're not doing anything wrong, you're just not quite getting the meaning of === and !== as opposed to == and !=. -Stut

« previous php.general (#244777) next »