php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #55351 0 and 1: no floats!
Submitted: 2011-08-02 20:52 UTC Modified: 2011-11-07 19:40 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: valentinknabel at gmail dot com Assigned:
Status: Not a bug Package: Website problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
 [2011-08-02 20:52 UTC] valentinknabel at gmail dot com
Description:
------------
---
From manual page: http://www.php.net/function.floatval%23R%C3%BCckgabewerte
---
Rückgabewerte

Der float-Wert der übergebenen Variable. Leere Arrays geben immer den Wert 0 
zurück, nichtleere Arrays den Wert 1.
---

Deutsch:
0 und 1 sind keine Floate sondern Integer.
0.0 und 1.0 sind Floate.

English:
0 and 1 are no floats, they are integer.
0.0 and 1.0 are floats.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-26 19:16 UTC] bradley@php.net
I don't see the problem. The "0" and "1" returned by floatval are of type float:

php > var_dump(floatval(array()));
float(0)
php > var_dump(floatval(array('foo', 'bar')));
float(1)
 [2011-08-27 09:46 UTC] valentinknabel at gmail dot com
typeof(1) != typeof(1.0)
:)
 [2011-11-07 19:40 UTC] kalle@php.net
-Status: Open +Status: Bogus
 [2011-11-07 19:40 UTC] kalle@php.net
Please re-report this in ENGLISH (change the status back to Open)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 01 02:01:31 2024 UTC