php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #65951 msec is not in microseconds as stated in documentation
Submitted: 2013-10-23 14:29 UTC Modified: 2013-10-25 15:58 UTC
Votes:1
Avg. Score:2.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: tim at possibilogy dot com Assigned: krakjoe (profile)
Status: Closed Package: Documentation problem
PHP Version: Irrelevant OS: Mac OSX
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: tim at possibilogy dot com
New email:
PHP Version: OS:

 

 [2013-10-23 14:29 UTC] tim at possibilogy dot com
Description:
------------
---
From manual page: http://www.php.net/function.microtime#refsect1-function.microtime-returnvalues
---


The documentation stats the msec is in microseconds. THe msec portion of the returned result is actually in floating SECONDS value. If it was in microseconds it would be an integer, not starting with "0.". As the example code shows it is a floating seconds value. 

Test script:
---------------
echo microtime();

Expected result:
----------------
I expect (based on documentation) a result like:

965841 1382538279

Actual result:
--------------
I actually get:

0.96584100 1382538279

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-10-23 15:23 UTC] salathe@php.net
-Status: Open +Status: Not a bug
 [2013-10-23 15:23 UTC] salathe@php.net
"and msec is the number of microseconds that have elapsed since sec expressed in seconds."

Note the units that msec is "expressed in".
 [2013-10-23 16:15 UTC] derick@php.net
-Status: Not a bug +Status: Re-Opened
 [2013-10-23 16:15 UTC] derick@php.net
The value is not in microseconds, it is in seconds.
 [2013-10-23 16:25 UTC] tim at possibilogy dot com
Not only is the value for msec in seconds (floating), but it is not even in microseconds given the number of displayed digits is incompatible with it being in microseconds (should only be 0.nnnnnn with 6 digits of precision not 8). 

My issue is the wording is awkward and inaccurate. Saying "since sec expressed in seconds" sounds like sec IS EXPRESSED in seconds which is correct, but irrelevant to msec in the existing sentence, which says "msec is the number of microseconds". 

I am not suggesting the return values change, just that the documentation becomes clearer.
 [2013-10-25 15:58 UTC] krakjoe@php.net
Automatic comment from SVN on behalf of krakjoe
Revision: http://svn.php.net/viewvc/?view=revision&revision=331966
Log: #65951 clarity in description
 [2013-10-25 15:58 UTC] krakjoe@php.net
-Status: Re-Opened +Status: Closed -Assigned To: +Assigned To: krakjoe
 [2013-10-25 15:58 UTC] krakjoe@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.


 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 03:00:02 2026 UTC