📁 File Manager Pro
v10.0.3 | PHP: 8.2.31
Server: LiteSpeed
2026-07-02 04:32:14
📂
/ (Root)
/
opt
/
alt
/
tests
/
alt-php85-pecl-mongodb_2.3.1-1.el8
/
tests
📍 /opt/alt/tests/alt-php85-pecl-mongodb_2.3.1-1.el8/tests
🔄 Refresh
✏️
Editing: packed_bit-002.phpt
Read Only
--TEST-- Tests of Binary subtype 9, Vectors, with dtype PACKED_BIT: Simple Vector PACKED_BIT --DESCRIPTION-- Generated by scripts/convert-bson-binary-vector-tests.php DO NOT EDIT THIS FILE --FILE-- <?php require_once __DIR__ . '/../utils/basic.inc'; // Vector [127,7] with padding 0 $vector = array ( 0 => 0, 1 => 1, 2 => 1, 3 => 1, 4 => 1, 5 => 1, 6 => 1, 7 => 1, 8 => 0, 9 => 0, 10 => 0, 11 => 0, 12 => 0, 13 => 1, 14 => 1, 15 => 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('1600000005766563746F7200040000000910007F0700')); var_dump($binary == $bson['vector']); ?> ===DONE=== <?php exit(0); ?> --EXPECT-- 1600000005766563746f7200040000000910007f0700 bool(true) ===DONE===
💾 Save Changes
❌ Cancel