Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2001072

[PHP] If Failing - Very strange From: Mitch Vincent (mvincent <email protected>)
Date: 07/31/01

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 <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>