From:             phpbugs at musiclogistics dot net
Operating system: Windows 7
PHP version:      5.4.14
Package:          Date/time related
Bug Type:         Bug
Bug description:microtime regression - resolution reduced to 64 ticks per second

Description:
------------
Probably caused by recent patch for bug #64370:

Since v 5.4.14 microtime() only moves forward in 15,6 ms (1/64 sec)
increments on Win7. Same for CLI and Apache 2.2 SAPI.

Build: VC9 x86 Thread Safe (2013-Apr-10 22:55:28) from windows.php.net.

Behaviour normal after downgrade to 5.4.13.

This also breaks usleep() (only sleeping for multiples of 15,6 ms now) and
uniqid() (returning the same value for 15,6 ms with $more_entropy = false).

Test script:
---------------
for ($startTimeMs = currentTimeMs(), $i = 0; $i < 10000; $i++) {
        //usleep(1);
        echo (currentTimeMs() - $startTimeMs) . ' ';
}

function currentTimeMs() {
        return round(microtime(true) * 1000000);
}

Expected result:
----------------
[what PHP 5.4.13 prints on the same machine:]

13 28 35 41 48 54 61 67 74 80 86 92 99 105 112 118 124 131 137 143 149 155
162 168 174 181 187 193 200 206 212 218 224 [...and so on]


Actual result:
--------------
0 0 0 0 0 0 0 0 0 [many more zeroes] 15600 15600 15600 15600 [...] 31200
31200 31200 31200 31200 [...] 46800 46800 46800 46800 46800 [...and so on]

-- 
Edit bug report at https://bugs.php.net/bug.php?id=64633&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64633&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64633&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=64633&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64633&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64633&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64633&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64633&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64633&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64633&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64633&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=64633&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=64633&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64633&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64633&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64633&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64633&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64633&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64633&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64633&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64633&r=mysqlcfg

Reply via email to