From: andy at laut dot de
Operating system: SuSe Linux 9.2
PHP version: 4.3.10
PHP Bug Type: *General Issues
Bug description: Although localeconv() reports , for decimal_point
calculations fail
Description:
------------
There seems to be a failure in internal number formating. Although my
locale is set correctly and localeconf returns the expected information,
which says, that decimal_point is the komma, calculations with komma as
decimal-separator fail.
Versions of PHP <4.3 behave as i expect, but since 4.3 scripts which uses
the komma for decimal-separator don't calculate correctly anymore...
My Configure-Line:
'./configure' '--with-apxs=/www/apache-1.3.33/bin/apxs'
'--prefix=/www/apache-1.3.33/php-4.3.10' '--with-gd' '--with-zlib'
'--with-mysql' '--enable-trans-sid' '--enable-ftp'
'--with-mnogosearch=/www/mnogosearch'
Reproduce code:
---------------
#As anybody can see here, the locale is set correctly
setlocale (LC_ALL, '[EMAIL PROTECTED]', 'de_DE', 'de', 'ge');
echo strftime ("%A %e %B %Y", mktime (0, 0, 0, 12, 22, 1978));
#localeconf returns the expected information
$locale_info = localeconv();
print_r($locale_info);
#But what the heck, this print doesn't
print("1,00+1,99=" . "1,00" + "1,99" . "<br/>\n");
/* If you uncomment this, parse error occurs
$x = 2,99;
$y = 3,27;
print($x+$y);
*/
Expected result:
----------------
Freitag 22 Dezember 1978
Array
(
[decimal_point] => ,
[thousands_sep] => .
[int_curr_symbol] => EUR
[currency_symbol] => �
[mon_decimal_point] => ,
[mon_thousands_sep] => .
[positive_sign] =>
[negative_sign] => -
[int_frac_digits] => 2
[frac_digits] => 2
[p_cs_precedes] => 0
[p_sep_by_space] => 1
[n_cs_precedes] => 0
[n_sep_by_space] => 1
[p_sign_posn] => 1
[n_sign_posn] => 1
[grouping] => Array
(
[0] => 3
[1] => 3
)
[mon_grouping] => Array
(
[0] => 3
[1] => 3
)
)
2,99
6,26
Actual result:
--------------
Freitag 22 Dezember 1978
Array
(
[decimal_point] => ,
[thousands_sep] => .
[int_curr_symbol] => EUR
[currency_symbol] => �
[mon_decimal_point] => ,
[mon_thousands_sep] => .
[positive_sign] =>
[negative_sign] => -
[int_frac_digits] => 2
[frac_digits] => 2
[p_cs_precedes] => 0
[p_sep_by_space] => 1
[n_cs_precedes] => 0
[n_sep_by_space] => 1
[p_sign_posn] => 1
[n_sign_posn] => 1
[grouping] => Array
(
[0] => 3
[1] => 3
)
[mon_grouping] => Array
(
[0] => 3
[1] => 3
)
)
2
5
--
Edit bug report at http://bugs.php.net/?id=32868&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32868&r=trysnapshot4
Try a CVS snapshot (php5.0):
http://bugs.php.net/fix.php?id=32868&r=trysnapshot50
Try a CVS snapshot (php5.1):
http://bugs.php.net/fix.php?id=32868&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=32868&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=32868&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=32868&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=32868&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=32868&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=32868&r=support
Expected behavior: http://bugs.php.net/fix.php?id=32868&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=32868&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=32868&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=32868&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32868&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=32868&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=32868&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=32868&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=32868&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=32868&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=32868&r=mysqlcfg