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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: nikhil dot gupta at in dot ibm dot com
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Fri Apr 26 04:01:30 2024 UTC