php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #64982 gettype(1.545) returns deprecated "double"
Submitted: 2013-06-06 22:45 UTC Modified: 2013-06-12 19:52 UTC
From: bas at dmt-software dot nl Assigned:
Status: Wont fix Package: *General Issues
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
5 + 36 = ?
Subscribe to this entry?

 
 [2013-06-06 22:45 UTC] bas at dmt-software dot nl
Description:
------------
Currently gettype(1.5456) returns "double" that is deprecated since 4.2.0, it should return "float". 
The documentation says "for historical reasons "double" is returned", but is it not just forgotten to change.

If it can not be changed for legacy reasons it might be useful to add an extra parameter (like a predefined constant) to toggle deprecated "double" or "float" return value.

 



Test script:
---------------
print(gettype(1.15545));


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-06-12 19:52 UTC] aharvey@php.net
-Status: Open +Status: Wont fix
 [2013-06-12 19:52 UTC] aharvey@php.net
I don't think there's any real value in complicating the implementation of 
gettype() for this, particularly since the type is called double internally 
anyway (for example: the IS_DOUBLE constant in the Zend Engine).
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 15:01:33 2024 UTC