#41517 [Csd]: floatval() function donot output the result in PHP6 with Unicode ON.
| From: | tony2001@php.net | Date: | Mon, 28 May 2007 20:27:33 +0000 |
| Subject: | #41517 [Csd]: floatval() function donot output the result in PHP6 with Unicode ON. | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-113122@lists.php.net to get a copy of this message | ||
ID: 41517
Updated by: tony2001@php.net
Reported By: nikhil dot gupta at in dot ibm dot com
Status: Closed
Bug Type: *Unicode Issues
Operating System: Linux, Win32-xp
PHP Version: 6CVS-2007-05-28 (snap)
New Comment:
If you have any tests for floatval(), please feel free to submit them
even if they fail atm.
Previous Comments:
------------------------------------------------------------------------
[2007-05-28 20:26:56] tony2001@php.net
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
------------------------------------------------------------------------
[2007-05-28 12:17:19] nikhil dot gupta at in dot ibm dot com
Description:
------------
When a string starting with number (eg. "22.23abc") is given as input
to floatval() function, no output is generated with PHP6 unicode ON
whereas it outputs correct result with php5 and php6 when unicode is
OFF. According to documentation, this type of string is acceptable by
the function. Hence there should be output with PHP6 with both modes
(unicode ON and OFF).
Reproduce code:
---------------
--TEST--
--FILE--
<?php
$string = "22.34abcd";
var_dump( floatval($string) );
?>
--EXPECT--
Expected result:
----------------
Notice: A non well formed numeric value encountered in %s on line %d
float(22.34)
Actual result:
--------------
Warning: floatval() expects parameter 1 to be double, Unicode string
given in %s on line %d
NULL
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41517&edit=1