函数名:MongoDB\BSON\Int64::serialize()
适用版本:PHP 5.6.0+
用法: MongoDB\BSON\Int64::serialize() 函数用于将 Int64 对象序列化为字符串。
语法: public function MongoDB\BSON\Int64::serialize(): string
参数: 该函数没有参数。
返回值: 返回一个字符串,表示序列化后的 Int64 对象。
示例:
$int64 = new MongoDB\BSON\Int64(1234567890);
$serialized = $int64->serialize();
echo $serialized;
输出:
BSON64\x00\x00\x00\x00\x00\x00\x49\x96\x02\x00\x00
注意事项: