2024 日本 PHP 研討會

MongoDB\BSON\Timestamp::__construct

(mongodb >=1.0.0)

MongoDB\BSON\Timestamp::__construct建構新的時間戳記

說明

final public MongoDB\BSON\Timestamp::__construct(int $increment, int $timestamp)

參數

increment (int)

一個 32 位元的整數,表示在給定秒數內的遞增序號。

timestamp (int)

一個 32 位元的整數,表示自 Unix 紀元以來的秒數。

錯誤/例外

範例

範例 #1 MongoDB\BSON\Timestamp::__construct() 範例

<?php

$timestamp
= new MongoDB\BSON\Timestamp(1234, 5678);

?>

上述範例將輸出

object(MongoDB\BSON\Timestamp)#1 (2) {
  ["increment"]=>
  int(1234)
  ["timestamp"]=>
  int(5678)
}
新增註記

使用者貢獻的註記

此頁面沒有使用者貢獻的註記。
To Top