PHP 4.0 Bug #7156: equal datatypes and equal values not response in if structure
| From: | hboveri at bancobisel dot com dot ar | Date: | Thu, 12 Oct 2000 13:02:58 +0000 |
| Subject: | PHP 4.0 Bug #7156: equal datatypes and equal values not response in if structure | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-34784@lists.php.net to get a copy of this message | ||
From: hboveri@bancobisel.com.ar
Operating system: solaris 2.7
PHP version: 4.0.3
PHP Bug Type: Unknown/Other Function
Bug description: equal datatypes and equal values not response in if structure
<?
// *******************
// Inicializo el ERROR
// *******************
$MSG_ERROR = "";
$cuota = 10;
$cuota_hasta = 12;
$Cobranza = "656.81";
$gHonorarios = 10;
$gcuota_vencida = "N";
$rec_cli_suc_cod = "rec_cli_suc_cod";
$rec_cli_nro_cli = "rec_cli_nro_cli";
$rec_cli_desc_cli = "rec_cli_desc_cli";
$rec_lin_codigo = "rec_lin_codigo";
$rec_lin_desc_lin = "rec_lin_desc_lin";
$rec_cuo_fec_vto = "rec_cuo_fec_vto";
$rec_pre_nro_sol = "rec_pre_nro_sol";
$rec_pre_suc_res = "rec_pre_suc_res";
$a_cobrar[1] = "596.68";
$a_cobrar[2] = "0.35";
$a_cobrar[3] = "0.07";
$a_cobrar[4] = "0.0";
$a_cobrar[5] = "0.0";
$a_cobrar[6] = "0.0";
$a_cobrar[7] = "0.0";
$a_cobrar[8] = "0.0";
$a_cobrar[9] = "0.0";
$a_cobrar[10] = "0.0";
// ****************************************
// Calculo el Total a Pagar de la CUOTA
// ****************************************
$SubTotal = 0.0;
for( $i = 1; $i <= 10; $i++ ){
$SubTotal += $a_cobrar[$i];
}
echo gettype($SubTotal) . " ($SubTotal) SubTotal <br>";
// **********************
// Calculo los honorarios
// **********************
$total_honorarios = 0.0;
$total_honorarios = $SubTotal * $gHonorarios / 100.0;
echo gettype($total_honorarios) . " ($total_honorarios) total_honorarios <br>";
// ************************
// Acumulo al Total a Pagar
// ************************
$total_a_pagar = 0;
echo( "subtotal,total_honorarios: $SubTotal + $total_honorarios<br>" );
$total_a_pagar = $SubTotal + $total_honorarios;
echo strlen($total_a_pagar) . " " . gettype($total_a_pagar) . " ($total_a_pagar)
total_a_pagar <br>";
echo strlen($Cobranza) . " " . gettype($Cobranza) . " ($Cobranza)
Cobranza <br>";
settype( $Cobranza, "double" );
echo strlen($total_a_pagar) . " " . gettype($total_a_pagar) . " ($total_a_pagar)
total_a_pagar <br>";
echo strlen($Cobranza) . " " . gettype($Cobranza) . " ($Cobranza)
Cobranza <br>";
// --------------------------------------------------------------------
// this is the cuestion !!!
if( $Cobranza >= $total_a_pagar ) {
// --------------------------------------------------------------------
echo "<br>ok";
} else {
echo "<br>error";
}
?>
--
Edit Bug report at: http://bugs.php.net/?id=7156&edit=1