Doc #60162 [Opn->Bgs]: Documentation Bug

From: Date: Tue, 01 Nov 2011 22:17:53 +0000
Subject: Doc #60162 [Opn->Bgs]: Documentation Bug
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-7372@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=60162&edit=1 ID: 60162 Updated by: salathe@php.net Reported by: jon at buymydreamhotel dot com Summary: Documentation Bug -Status: Open +Status: Bogus Type: Documentation Problem Package: Documentation problem Operating System: Windows PHP Version: Irrelevant Block user comment: N Private report: N New Comment: The "return values" section of the microtime manual page makes it clear what the value is representing. The 0.36411000 in your first example "is the number of microseconds that have elapsed since sec expressed in seconds." The important part here are the last three words: expressed in seconds. The microtime portion of the time is expressed as a decimal fraction of a second. Previous Comments: ------------------------------------------------------------------------ [2011-10-28 19:28:59] jon at buymydreamhotel dot com Description: ------------ --- From manual page: http://www.php.net/function.microtime#refsect1-function.microtime-returnvalues --- Hello, on the basis of experimentation I disagree with the wording of the documentation for microtime. I cannot see the documentation whilst I write this but basically the default behaviour is to split the return into the number of seconds since some date in the 1970s and then the other part is described as being the number of microseconds since that time indicated by the whole number of seconds. I see numbers like this... 0.36411000 1319829349 0.42210500 1319829349 In this case the number of seconds is the same but the first part of each time shows a sub-second difference. HOWEVER as I understand it this is NOT the number of microseconds but actually a decimal or float representation of the part that cannot be expressed as whole seconds, the numbers may indicate microseconds in the sense that they offer a certain resolution but the units here are still seconds? I can understand what the definition is attempting to say but it is inaccurate and badly expressed. Several contributors have defined a function which is intended for users who lack the option to give the answer as a float and they simply add the first part to the second part. If the first part was actually expressed in microseconds then it would be necessary to multiply by one million to get the units into seconds before adding to the whole seconds part. If I have mis-understood then the examples given by contributors lack a scaling value of 1 million and should be removed or corrected for clarity. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60162&edit=1

« previous php.doc.bugs (#7372) next »