--TEST-- Tests of Binary subtype 9, Vectors, with dtype PACKED_BIT: PACKED_BIT with padding --DESCRIPTION-- Generated by scripts/convert-bson-binary-vector-tests.php DO NOT EDIT THIS FILE --FILE-- 0, 1 => 1, 2 => 1, 3 => 1, 4 => 1, 5 => 1, 6 => 1, 7 => 1, 8 => 0, 9 => 0, 10 => 0, 11 => 0, 12 => 1, ); $binary = MongoDB\BSON\Binary::fromVector($vector, \MongoDB\BSON\VectorType::PackedBit); echo bin2hex((string) MongoDB\BSON\Document::fromPHP(['vector' => $binary])), "\n"; $bson = MongoDB\BSON\Document::fromBSON(hex2bin('1600000005766563746F7200040000000910037F0800')); var_dump($binary == $bson['vector']); ?> ===DONE=== --EXPECT-- 1600000005766563746f7200040000000910037f0800 bool(true) ===DONE===