|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #80683 Untrue statement about microtime() precision
Submitted: 2021-01-28 19:03 UTC Modified: 2021-01-28 22:37 UTC
From: php4fan at gmail dot com Assigned: danack (profile)
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: php4fan at gmail dot com
New email:
PHP Version: OS:


 [2021-01-28 19:03 UTC] php4fan at gmail dot com
From manual page:

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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-01-28 19:08 UTC] php4fan at gmail dot com
-Status: Open +Status: Closed
 [2021-01-28 19:08 UTC] 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:10 UTC]
-Assigned To: +Assigned To: danack
 [2021-01-28 19:10 UTC]
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 .
 [2021-01-28 22:37 UTC]
-Status: Closed +Status: Not a bug
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Sep 18 06:03:37 2021 UTC