PHP 4.0 Bug #7850 Updated: settype() function
| From: | carlos at vlcnet dot com dot br | Date: | Thu, 16 Nov 2000 18:08:03 +0000 |
| Subject: | PHP 4.0 Bug #7850 Updated: settype() function | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-38364@lists.php.net to get a copy of this message | ||
ID: 7850
User Update by: carlos@vlcnet.com.br
Status: Open
Bug Type: Unknown/Other Function
Description: settype() function
Please, verify the script below,
this error occurred with others values in this variable too.
------------------------------------------------------------<?php
function retorna_cnpj($cnpj) {
$new_var = ereg_replace("[/\.\-]","",$cnpj);
echo $new_var . "<br>";
$nada = settype($new_var,"integer");
echo $new_var . "<br>";
return $new_var;
}
$w_cnpj = "12.345.678/0002-12";
echo $w_cnpj . "<br>";
echo retorna_cnpj($w_cnpj) . "<br>";
?>
------------------------------------------------------------
It must return 12345678000212 as integer, but
php return for me the number: 2147483647
Thanks
Carlos Portella
Previous Comments:
---------------------------------------------------------------------------
[2000-11-16 12:55:03] carlos@vlcnet.com.br
Please, verify the script below,
this error occurred with others values in this variable too.
------------------------------------------------------------
<?php
function retorna_cnpj($cnpj)
$new_var = ereg_replace("[/.-",$cnpj);
$new_var = settype($new_var,"integer");
return $new_var;
}
$w_cnpj = "12.345.678/0002-12"
echo retorna_cnpj($w_cnpj);
?>
------------------------------------------------------------
It must return 12345678000212 as integer, but
php return for me the number: 2147483647
Thanks
Carlos Portella
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=7850