Re: is this a bug in PHP4?

From: Date: Wed, 20 Dec 2000 22:24:30 +0000
Subject: Re: is this a bug in PHP4?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-31330@lists.php.net to get a copy of this message
read about comparing different variable types. $var === "am" (three equal signs) will eval to false. At 23:08 20.12. 2000, phpmail@intranet.alpsnet.com wrote the following: -------------------------------------------------------------- ><? > $var = 0; > echo "--$var--<br>"; > if($var == "am") echo "var == am is true"; > else echo "var == am is false"; >?> > >If you run that on PHP 4.0 or PHP 4.0.3pl1 you will see that > > if($var == "am") evaluates to TRUE > >This looks like a bug because I just set $var to zero. > >zero != "am", right? > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net ------end of quote------ ____________________________________________________________ Cynic: A member of a group of ancient Greek philosophers who taught that virtue constitutes happiness and that self control is the essential part of virtue. cynic@mail.cz

« previous php.general (#31330) next »