php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41517 floatval() function donot output the result in PHP6 with Unicode ON.
Submitted: 2007-05-28 12:17 UTC Modified: 2007-05-28 20:27 UTC
From: nikhil dot gupta at in dot ibm dot com Assigned:
Status: Closed Package: *Unicode Issues
PHP Version: 6CVS-2007-05-28 (snap) OS: Linux, Win32-xp
Private report: No CVE-ID: None
 [2007-05-28 12:17 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-28 20:26 UTC] 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 20:27 UTC] tony2001@php.net
If you have any tests for floatval(), please feel free to submit them even if they fail atm.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC