ZerethShell
File Manager
SQL Manager
/
opt
/
alt
/
tests
/
alt-php85-pecl-mongodb_2.3.1-1.el8
/
tests
float32-001.phpt
--TEST-- Tests of Binary subtype 9, Vectors, with dtype FLOAT32: Simple Vector FLOAT32 --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 => 127.0, 1 => 7.0, ); $binary = MongoDB\BSON\Binary::fromVector($vector, \MongoDB\BSON\VectorType::Float32); echo bin2hex((string) MongoDB\BSON\Document::fromPHP(['vector' => $binary])), "\n"; $bson = MongoDB\BSON\Document::fromBSON(hex2bin('1C00000005766563746F72000A0000000927000000FE420000E04000')); var_dump($binary == $bson['vector']); ?> ===DONE=== <?php exit(0); ?> --EXPECT-- 1c00000005766563746f72000a0000000927000000fe420000e04000 bool(true) ===DONE===
Kaydet
Vazgeç