private function legacyGetMongoDbDateTime(\DateTimeInterface $value): UTCDateTime
    {
        $milliseconds = floor($value->format('U.u') * 1000);

        $milliseconds = (PHP_INT_SIZE == 8) //64-bit OS?
            ? (int) $milliseconds
            : (string) $milliseconds;

        return new UTCDateTime($milliseconds);
    }
private function legacyGetMongoDbDateTime(\DateTimeInterface $value): UTCDateTime
    {
        $milliseconds = floor($value->format('U.u') * 1000);

        $milliseconds = (PHP_INT_SIZE == 8) //64-bit OS?
            ? (int) $milliseconds
            : (string) $milliseconds;

        return new UTCDateTime($milliseconds);
    }
private function legacyGetMongoDbDateTime ( \ DateTimeInterface $ value ) : UTCDateTime { $ milliseconds = floor ( $ value -> format ( 'U.u' ) * 1000 ) ; $ milliseconds = ( PHP_INT_SIZE == 8 ) //64-bit OS? ? ( int ) $ milliseconds : ( string ) $ milliseconds ; return new UTCDateTime ( $ milliseconds ) ; }
This is needed to support MongoDB Driver v1.19 and below

See https://github.com/mongodb/mongo-php-driver/issues/426

It can probably be removed in 2.1 or later once MongoDB's 1.2 is released and widely adopted
This is needed to support MongoDB Driver v1 . 19 and below