MongoDB\BSON\Binary
PHP Manual

MongoDB\BSON\Binary::__construct

(mongodb >=1.0.0)

MongoDB\BSON\Binary::__constructConstruct a new Binary

说明

final public MongoDB\BSON\Binary::__construct ( string $data , integer $type )

参数

data (string)

Binary data.

type (integer)

Binary type.

错误/异常

范例

Example #1 MongoDB\BSON\Binary::__construct() example

<?php

$binary 
= new MongoDB\BSON\Binary('foo'MongoDB\BSON\Binary::TYPE_GENERIC);
var_dump($binary);

?>

以上例程会输出:

object(MongoDB\BSON\Binary)#1 (2) {
  ["data"]=>
  string(3) "foo"
  ["type"]=>
  int(0)
}

参见


MongoDB\BSON\Binary
PHP Manual