php8.5
Home/ Manual/ bson / binary/ MongoDB\BSON\Binary::getType

MongoDB\BSON\Binary::getType

PHP function Edit on GitHub ✎

(mongodb >=1.0.0)

Returns the Binary's type

Description

MongoDB\BSON\Binary::getType(): int

Parameters Parameters

Return Values

Returns the Binary's type.

Errors/Exceptions

Examples

MongoDB\BSON\Binary::getType() example

php
<?php

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

?>

The above example will output:

output
int(0)

See Also

  • BSON Types

Source: reference/mongodb/bson/binary/gettype.xml · from the official PHP manual (php/doc-en)