Re: Re:[PHP-WIN] Strange 'if' test bug?
| From: | Steve McGill | Date: | Tue, 31 Aug 2004 12:10:03 +0000 |
| Subject: | Re: Re:[PHP-WIN] Strange 'if' test bug? | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-24475@lists.php.net to get a copy of this message | ||
Well gee, thanks a lot for that....
I can't imagine why 0 == "foo" should be TRUE, but there it is.... I will
use === from now on.
I was convinced this was related to windows because I've never noticed this
behaviour with several years of experience with programming PHP on linux
systems.
Thanks for your patience, and your answer.
Best wishes,
Steve
"Nadim Attari" <nadim@alienworkers.com> schreef in bericht
news:20040831111350.90008.qmail@pb1.pair.com...
> http://www.blueshoes.org/en/developer/php_cheat_sheet/
> ------------------
>
> "William.Candillon@Tiscali.Fr" <william.candillon@tiscali.fr> a écrit dans
> le message de
> news:I3B3VI$0DB29DE9F5BD09BECC716F6E620D2A44@tiscali.fr...
> According to me it's a very strange problem
> Test this please :
> $key = '0';
> if($key == 'muppet')
> echo 'key is a muppet: ".$key;
> else
> echo 'key is something else: '.$key;
> Because I don't understang why $key return false :(