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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bas at dmt-software dot nl
New email:
PHP Version: OS:

 

 [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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri May 02 19:01:29 2025 UTC