Bug #17105: floating point numbers truncated due to locale
| From: | acm at tweakers dot net | Date: | Wed, 08 May 2002 22:42:32 +0000 |
| Subject: | Bug #17105: floating point numbers truncated due to locale | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-7271@lists.php.net to get a copy of this message | ||
From: acm@tweakers.net
Operating system: multiple linux versions
PHP version: 4.2.0
PHP Bug Type: Scripting Engine problem
Bug description: floating point numbers truncated due to locale
Using the code below results into truncation of the floating point numbers
if the code is included after the setlocale call.
I saw some old reports of this problem, but the developers claimt to have
fixed this.
Tested it on 3 servers, one running php4.2.0 with apache 1.3.24 on gentoo
linux 1.1a, the second using apache-1.3.24 with php4.1.2 on redhat 7.1 and
the third running apache-1.3.24 with php4.1.2 on slackware 7.
<?
include('class1.php');
$test = new class1();
setlocale(LC_ALL,"nl_NL");
$test = new class1();
include('class2.php');
$test = new class2();
?>
class1.php
<?
class class1
{
function class1()
{
$float = 1.1;
var_dump($float);
}
}
$float = 1.1;
var_dump($float);
?>
class2.php
<?
class class2
{
function class2()
{
$float = 1.1;
var_dump($float);
}
}
$float = 1.1;
var_dump($float);
?>
If you need any extra information, I'll supply you with that :)
--
Edit bug report at http://bugs.php.net/?id=17105&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=17105&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=17105&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=17105&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=17105&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=17105&r=support
Expected behavior: http://bugs.php.net/fix.php?id=17105&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=17105&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=17105&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=17105&r=globals