ID:          30611
 Updated by:  [EMAIL PROTECTED]
 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

Reply via email to