Filtering by date returns different results in PHP 5 and PHP 7

I’m supporting a very old project written in PHP 5 and which is now rewritten to PHP 7.
There is php_mongo extension is used in PHP 5 and php_mongodb is used in PHP 7.
There is also MongoDB 4.4 is used.

So, if I build query in PHP 5 I’m getting this as a result:

array(2) {
  ["$or"]=>
  array(2) {
    [0]=>
    array(2) {
      ["u"]=>
      array(1) {
        ["$in"]=>
        array(1) {
          [0]=>
          int(235941)
        }
      }
      ["p"]=>
      int(0)
    }
    [1]=>
    array(2) {
      ["r"]=>
      int(420087)
      ["p"]=>
      array(1) {
        ["$gte"]=>
        int(0)
      }
    }
  }
  ["t"]=>
  array(1) {
    ["$lt"]=>
    object(MongoDate)#75 (2) {
      ["sec"]=>
      int(1651739670)
      ["usec"]=>
      int(0)
    }
  }
}

And if I build query in PHP 7 I’m getting this as a result:

array(2) {
  ["$or"]=>
  array(2) {
    [0]=>
    array(2) {
      ["u"]=>
      array(1) {
        ["$in"]=>
        array(1) {
          [0]=>
          int(235941)
        }
      }
      ["p"]=>
      int(0)
    }
    [1]=>
    array(2) {
      ["r"]=>
      int(420087)
      ["p"]=>
      array(1) {
        ["$gte"]=>
        int(0)
      }
    }
  }
  ["t"]=>
  array(1) {
    ["$lt"]=>
    object(MongoDB\BSON\UTCDateTime)#100 (1) {
      ["milliseconds"]=>
      string(13) "1651739670000"
    }
  }
}

What can I do wrong here?