Doc #80683 [Csd]: Untrue statement about microtime() precision
| From: | danack@php.net | Date: | Thu, 28 Jan 2021 19:10:37 +0000 |
| Subject: | Doc #80683 [Csd]: Untrue statement about microtime() precision | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-18464@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80683&edit=1
ID: 80683
Updated by: danack@php.net
Reported by: php4fan at gmail dot com
Summary: Untrue statement about microtime() precision
Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: linux
PHP Version: Irrelevant
-Assigned To:
+Assigned To: danack
Block user comment: N
Private report: N
New Comment:
Yeah, not only is it not true, it's not a useful bug report anyway.
If you think something in the manual needs improving, please submit some better words at https://github.com/php/doc-en .
Previous Comments:
------------------------------------------------------------------------
[2021-01-28 19:08:39] php4fan at gmail dot com
Whops, sorry, not true, I was just printing it and it got rounded when converted to string.
------------------------------------------------------------------------
[2021-01-28 19:03:51] php4fan at gmail dot com
Description:
------------
---
From manual page: https://php.net/function.microtime
---
It states:
"If as_float is set to true, then microtime() returns a float, which represents the current
time in seconds since the Unix epoch accurate to the nearest microsecond."
That's not true. The value returned as float is not accurate to the nearest microsecond. Now I
guess that's obvious if you know what the precision of a float is, but if I read a sentence
that says "accurate to the nearest microsecond", I'm not going to do maths, I'll
assume that who wrote the sentence already did that for me, so if they say "accurate to the
nearest microsecond" I'll assume they figured out that the typical precision of a float is
enough to give you a 1-microsecond precision on such a number.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80683&edit=1