#30611 [Opn->Bgs]: microtime documentation small bug
| From: | derick@php.net | Date: | Fri, 29 Oct 2004 09:35:35 +0000 |
| Subject: | #30611 [Opn->Bgs]: microtime documentation small bug | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969364716@lists.php.net to get a copy of this message | ||
ID: 30611
Updated by: derick@php.net
Reported By: tux at centrum dot cz
-Status: Open
+Status: Bogus
Bug Type: Documentation problem
PHP Version: Irrelevant
New Comment:
Docs are correct, and your example is wrong.
Previous Comments:
------------------------------------------------------------------------
[2004-10-29 11:22:05] tux at centrum dot cz
Description:
------------
In documentation for microtime() at php.net, there is an example:
<?php
/**
* Simple function to replicate PHP 5 behaviour
*/
function microtime_float()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
..
shouldn't be the last line in microtime_float() this?
return ((float)$usec/(float)1000000 + (float)$sec);
Summing seconds and microseconds without conversion won;t work ...
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30611&edit=1