mirror of
https://github.com/Seldaek/monolog.git
synced 2025-10-22 00:56:08 +02:00
Fix microseconds support on 7.1, and enable it by default as 7.1 has no perf cost anymore
This commit is contained in:
@@ -23,10 +23,12 @@ class DateTimeImmutable extends \DateTimeImmutable implements \JsonSerializable
|
||||
|
||||
public function __construct($useMicroseconds, \DateTimeZone $timezone = null)
|
||||
{
|
||||
static $needsMicrosecondsHack = PHP_VERSION_ID < 70100;
|
||||
|
||||
$this->useMicroseconds = $useMicroseconds;
|
||||
$date = 'now';
|
||||
|
||||
if ($useMicroseconds) {
|
||||
if ($needsMicrosecondsHack && $useMicroseconds) {
|
||||
$timestamp = microtime(true);
|
||||
|
||||
// apply offset of the timezone as microtime() is always UTC
|
||||
|
Reference in New Issue
Block a user