PHP 7.0.6 Released

MongoDB\BSON\Binary::__construct

(mongodb >=1.0.0)

MongoDB\BSON\Binary::__constructConstruct a new Binary

Description

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

Parameters

data (string)

Binary data.

type (integer)

Binary type.

Errors/Exceptions

Examples

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

<?php

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

?>

The above example will output:

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

See Also

User Contributed Notes

There are no user contributed notes for this page.
To Top