Re: is this a bug in PHP4?
| From: | jeremy brand | Date: | Wed, 20 Dec 2000 22:30:19 +0000 |
| Subject: | Re: is this a bug in PHP4? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31332@lists.php.net to get a copy of this message | ||
This is not a bug. Automatic type conversion (or a manual typecast)
changes any alpha leading string to a zero number.
It is doing what is expected.
-jeremy brand
Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: jeremy@nirvani.net
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html
for more
Get your own Free, Private email at http://www.smackdown.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com
On Wed, 20 Dec 2000 phpmail@intranet.alpsnet.com wrote:
> Date: Wed, 20 Dec 2000 15:08:59 -0700 (MST)
> From: phpmail@intranet.alpsnet.com
> To: php-general@lists.php.net
> Subject: [PHP] is this a bug in PHP4?
>
>
> <?
> $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
>
>