You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Consider switching from microtime() to hrtime(), available in PHP 7.3. It provides a monotonic timestamp rather than a realtime timestamp.
How to reproduce
Using microtime() is unsafe e.g. on a DST crossover or whenever the system time is adjusted, since the timestamps aren't relative to each other.
It is used in the CurlMultiHandler and the on_stats option.
Apart from needing to keep support for < 7.3, the change here should be without a BC break.
The text was updated successfully, but these errors were encountered:
Llbe
changed the title
PHP 7.3: use hrtime() in favor of microtime()
PHP 7.3: use hrtime() instead of microtime()
Nov 21, 2018
Basically function_exists('hrtime') ? hrtime(true) / 1e9 : microtime(true) could be used (an internal wrapper would be preferable of course). See https://3v4l.org/BATQ7
Guzzle version(s) affected: 6.3.3
Description
Consider switching from microtime() to hrtime(), available in PHP 7.3. It provides a monotonic timestamp rather than a realtime timestamp.
How to reproduce
Using microtime() is unsafe e.g. on a DST crossover or whenever the system time is adjusted, since the timestamps aren't relative to each other.
It is used in the CurlMultiHandler and the
on_stats
option.Apart from needing to keep support for < 7.3, the change here should be without a BC break.
The text was updated successfully, but these errors were encountered: