|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #55464 differ is_float() from is_double()
Submitted: 2011-08-19 20:02 UTC Modified: 2011-08-23 03:45 UTC
From: zandor_zz at yahoo dot it Assigned:
Status: Not a bug Package: Variables related
PHP Version: Irrelevant OS: any
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.
Block user comment
Status: Assign to:
Bug Type:
From: zandor_zz at yahoo dot it
New email:
PHP Version: OS:


 [2011-08-19 20:02 UTC] zandor_zz at yahoo dot it
It would be nice to differ the behavior of is_float() from is_double(). This 
situation is not consistent cause float and double do differ for different 
byte size.
I have created a PHP class to handle advanced read/write operations on files and I 
crashed onto this ambiguous situation. Thus I wrote myself a workaround to solve 
this ambiguous situation. Then I suggest that it would be nice to rely on this 
feature in the standard PHP library.

Test script:
It is known from PHP standard documentation that is_double() is an alias of is_float().


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-23 03:45 UTC]
-Status: Open +Status: Bogus
 [2011-08-23 03:45 UTC]
There is only one floating point type in PHP -- it is named float, with "double" (and "real") as an alias and the underlying representation is a C double. Both is_float and is_double (and also is_real) test for this type. So the proposal makes no sense. As such, I'm closing this as bogus.

What I think you actually wanted to suggest is introducing a new type with single precision. This would be a rather big change with no compelling advantages (the double can represent all the values the float can) and possible BC breaks. In any case, such a change would require extended discussion; see
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Dec 05 15:01:28 2023 UTC