[EMAIL PROTECTED] wrote:
> 
> Hi all,
> 
> I got a problem comparing the string "inf" with another in PHP3. It is
> used as File-Extention for information-files on our system. When
> comparing the following all works fine and the expected result is given:
> 
> "otto"  =  "karl" =>0
> "otto"  =  "otto" =>1
> "otto"! = "karl"  =>1
> "otto"! =  "otto" =>0
> 
> The following problem occurs when comparing the string "inf":
> 
> "inf" = "otto" =>0 correct result
> "inf" = "inf"   =>0  incorrect result!!!! expected 1
> "inf" != "otto" =>1 correct result
> "inf" != "inf" => 1 incorrect result!!! expected: 0
> 
> Does anybody have any idea what´s wrong with the string "inf"? It is not
> an reserved word.
> 
> Tahnks in advance
> 
> Marco
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


Well... where shall I start...

Comparison: ==
Assingment: =
(and _not_ the other way 'round)

And then... Why would you even think about comparing to fixed
strings? You wouldn't. So I guess you'd like to send some real code
next time, so people can see what you're trying to do.

And then...
"inf" = "inf" doesn't work _at all_! It produces an error. If you
use "inf" == "inf" the result is exactly what you'd expect.

And then...
In your real code, which is something like $var = "inf", you should
use $var == "inf". If you do that, you won't have any problems.

-- 

* R&zE:

***************************
**  Renze Munnik
**
**  E: [EMAIL PROTECTED]
**  M: +31 6 218 111 43
***************************

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to