Re: Re: Bug #5772 Updated: if ("" == "0") inconsistent behavior on IIS 4.0

From: Date: Mon, 24 Jul 2000 23:51:18 +0000
Subject: Re: Re: Bug #5772 Updated: if ("" == "0") inconsistent behavior on IIS 4.0
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-25912@lists.php.net to get a copy of this message
> > In this case, FALSE won't work. If "</body" is the first part > of the line, strpos() returns "0" which is interpreted as false. At > least I'm assuming it will since "if (strpos(...))" evaluates as false > in that case. > "0" == 0 0 == FALSE "0" == FALSE These all eval. to true, bcz == juggles them to the same type before deciding evaluating. "0" === 0 0 === FALSE "0" === FALSE These all eval. to false, bcz === checks that both type AND value are the same. strpos() returns 0 as an integer if the string is found at position 0, and 0 as a boolean (ie, false) if it is not found at all.

« previous php.dev (#25912) next »