Re: If Failing - Very strange
| From: | Matt Kaufman | Date: | Tue, 31 Jul 2001 22:51:03 +0000 |
| Subject: | Re: If Failing - Very strange | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-60497@lists.php.net to get a copy of this message | ||
I'm not sure, but don't you do something with endif(); ?
Matt Kaufman
----- Original Message -----
From: "Mitch Vincent" <mvincent@cablespeed.com>
To: <php-general@lists.php.net>
Sent: Tuesday, July 31, 2001 12:57 PM
Subject: [PHP] If Failing - Very strange
> Could someone explain this?
>
> if( $fCredit > $fQuoteTotal )
> $fCredit = $fQuoteTotal;
>
> ^- Fails.
>
> if( $fCredit > $fQuoteTotal ) {
>
> $fCredit = $fQuoteTotal;
>
> }
>
> ^- Passes
>
> if((float)$fCredit > (float)$fQuoteTotal)
> $fCredit = $fQuoteTotal;
>
> ^- Passes.
>
> The curley braces seem to make all the difference here -- bug?
>
> Thanks!!!
>
> -Mitch
>
>
>
> --
> 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
>
>
>