From: andiesPostfach at web dot de Operating system: Suse Linux 9.3 PHP version: 5.2.0RC5 PHP Bug Type: Filter related Bug description: FILTER_VALIDATE_FLOAT doesn't uses decimal_point from locale
Description: ------------ FILTER_VALIDATE_FLOAT should use the decimal point info from the given locale. In my case (in Germany) it should use ','. Reproduce code: --------------- $loc_de = setlocale(LC_ALL, '[EMAIL PROTECTED]', 'de_DE', 'deu_deu'); echo "Preferred locale for german on this system is '$loc_de'"; $locale_info = localeconv(); print_r($locale_info); // This should work an give 0,27 $value = "0,27"; echo "Value is: ".filter_var( $value, FILTER_VALIDATE_FLOAT ); // This shouldn't work but it gives 0,27 $value = "0.27"; echo "Value is: ".filter_var( $value, FILTER_VALIDATE_FLOAT ); Expected result: ---------------- Preferred locale for german on this system is '[EMAIL PROTECTED]'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 ) ) Value for 0,27 is: 0,27<br /> Value for 0.27 is: <br /> Actual result: -------------- Preferred locale for german on this system is '[EMAIL PROTECTED]'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 ) ) Value for 0,27 is: <br /> Value for 0.27 is: 0,27<br /> -- Edit bug report at http://bugs.php.net/?id=39158&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39158&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39158&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39158&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39158&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39158&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39158&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39158&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39158&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39158&r=support Expected behavior: http://bugs.php.net/fix.php?id=39158&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39158&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39158&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39158&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39158&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39158&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39158&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39158&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39158&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39158&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39158&r=mysqlcfg