#40653 [NEW]: strval() and floatval() behave differently

From: Date: Tue, 27 Feb 2007 01:39:51 +0000
Subject: #40653 [NEW]: strval() and floatval() behave differently
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-109624@lists.php.net to get a copy of this message
From: plyrvt at mail dot ru Operating system: Any PHP version: 5.2.1 PHP Bug Type: Strings related Bug description: strval() and floatval() behave differently Description: ------------ Either strval() or floatval() is buggy. They can respect locale or ignore locale, but at least both do things the same way! Reproduce code: --------------- <?php setlocale(LC_NUMERIC, "ANY_LOCALE_WITH_,_SEPARATOR"); $f=1.2; $s=strval($f); $f=floatval($s); var_dump($f); // expected: 1.2 or 1,2 // actual: 1 ?> -- Edit bug report at http://bugs.php.net/?id=40653&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40653&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40653&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40653&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40653&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40653&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40653&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40653&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40653&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40653&r=support Expected behavior: http://bugs.php.net/fix.php?id=40653&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40653&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40653&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40653&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40653&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40653&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40653&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40653&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40653&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40653&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40653&r=mysqlcfg

« previous php.bugs (#109624) next »