Overview
KB
Technical FAQ
PHP Manual
CSS2 Manual
HTML Manual
JS Guide
JS Reference
PhpDock Manual
Nu-Coder Manual
PhpExpress Manual
PHP Joomla
Development
Learn PHP
 
<MongoDB\BSON\PackedArray::toCanonicalExtendedJSONMongoDB\BSON\PackedArray::toRelaxedExtendedJSON>
^MongoDB\BSON\PackedArrayLast updated: Mon, 26 Oct 2026

MongoDB\BSON\PackedArray::toPHP

(mongodb >=1.16.0)

MongoDB\BSON\PackedArray::toPHP — Returns the PHP representation of the BSON array

Description

final public function MongoDB\BSON\PackedArray::toPHP(?array $typeMap = null): array|object

Parameters

typeMap (array)

Type map configuration.

Return Values

The decoded PHP value.

Note:

When encountering a value encoded as 64-bit integer in the BSON array, the return value of this method will be a MongoDB\BSON\Int64 instance.

Errors/Exceptions

See Also


<MongoDB\BSON\PackedArray::toCanonicalExtendedJSONMongoDB\BSON\PackedArray::toRelaxedExtendedJSON>
^MongoDB\BSON\PackedArrayLast updated: Mon, 26 Oct 2026