📁 File Manager Pro
v10.0.3 | PHP: 7.4.33
Server: LiteSpeed
2026-07-12 05:09:42
📂
/ (Root)
/
opt
/
alt
/
tests
/
alt-php81-pecl-mongodb_1.18.1-1.el8
/
tests
📍 /opt/alt/tests/alt-php81-pecl-mongodb_1.18.1-1.el8/tests
🔄 Refresh
✏️
Editing: bson-document-get-001.phpt
Read Only
--TEST-- MongoDB\BSON\Document::get() key access --FILE-- <?php require_once __DIR__ . '/../utils/basic.inc'; $document = MongoDB\BSON\Document::fromPHP([ 'foo' => 'bar', 'bar' => 'baz', 'int64' => new MongoDB\BSON\Int64(123), ]); var_dump($document->get('foo')); var_dump($document->get('bar')); var_dump($document->get('int64')); echo throws(function() use ($document) { var_dump($document->get('baz')); }, MongoDB\Driver\Exception\RuntimeException::class), "\n"; ?> ===DONE=== <?php exit(0); ?> --EXPECTF-- string(3) "bar" string(3) "baz" object(MongoDB\BSON\Int64)#%d (%d) { ["integer"]=> string(3) "123" } OK: Got MongoDB\Driver\Exception\RuntimeException Could not find key "baz" in BSON document ===DONE===
💾 Save Changes
❌ Cancel