Doc #55351 [Com]: 0 and 1: no floats!
| From: | valentinknabel at gmail dot com | Date: | Sat, 27 Aug 2011 09:46:39 +0000 |
| Subject: | Doc #55351 [Com]: 0 and 1: no floats! | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-7070@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55351&edit=1
ID: 55351
Comment by: valentinknabel at gmail dot com
Reported by: valentinknabel at gmail dot com
Summary: 0 and 1: no floats!
Status: Open
Type: Documentation Problem
Package: Website problem
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
typeof(1) != typeof(1.0)
:)
Previous Comments:
------------------------------------------------------------------------
[2011-08-26 19:16:55] 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-02 20:52:39] 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.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55351&edit=1