Bug #64085 [Fbk->Opn]: microtime(true) undervalued
| From: | bugzilla77 at gmail dot com | Date: | Mon, 28 Jan 2013 08:33:03 +0000 |
| Subject: | Bug #64085 [Fbk->Opn]: microtime(true) undervalued | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-176296@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=64085&edit=1
ID: 64085
User updated by: bugzilla77 at gmail dot com
Reported by: bugzilla77 at gmail dot com
Summary: microtime(true) undervalued
-Status: Feedback
+Status: Open
Type: Bug
Package: Date/time related
Operating System: Windows 7 x86/x64
PHP Version: 5.5.0alpha4
Block user comment: N
Private report: N
New Comment:
Imagine that time() and microtime (true) are very similar.
The difference is the type of data returned: int and float.
The integer part must be the same them at the same moment.
Can you imagine this obviousness?
PHP 5.5 return values different by 10 seconds!
PHP 5.4 will never wrong on the same machine.
Previous Comments:
------------------------------------------------------------------------
[2013-01-28 00:53:49] sixd@php.net
Regardless of whether it makes sense to compare the two functions, or regardless
of whatever Windows system calls the two functions expose, I'd expect time1-time2
to be negative. Please review the testcase and clarify the problem description.
------------------------------------------------------------------------
[2013-01-27 19:03:58] bugzilla77 at gmail dot com
Description:
------------
This bug is inaugurated in PHP 5.5: microtime(true) is undervalued up to several
seconds!
The difference increases in time to work the server (after a few days more than 10
seconds).
I am watching now test script -5.2 seconds, after Apache restart difference is
positive.
I am using Apache 2.2 module on Windows 7 x86/x64.
Test script:
---------------
microtime(true): <?=$mt=microtime(true)?><br/>
time(): <?=$t=time()?><br/><br/>
microtime(true) - time(): <?=$mt-$t?><br/><br/>
difference should be greater than zero and less than one
Expected result:
----------------
PHP 5.4: microtime(true) >= time()
microtime(true): 1359313026.5983
time(): 1359313026
microtime(true) - time(): 0.59834909439087
difference should be greater than zero and less than one
Actual result:
--------------
PHP 5.5: microtime(true) < time()
microtime(true): 1359312493.8386
time(): 1359312499
microtime(true) - time(): -5.1614379882812
difference should be greater than zero and less than one
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64085&edit=1