--TEST-- MongoDB\BSON\Document::fromPHP() copies BSON data from Document and PackedArray --FILE-- toRelaxedExtendedJSON(), "\n"; // This will be interpreted as an object after copying, i.e. { "0": 1, "1": 2, "2": 3 } $packedArray = MongoDB\BSON\PackedArray::fromPHP([ 1, 2, 3 ]); $fromPackedArray = MongoDB\BSON\Document::fromPHP($packedArray); echo $fromPackedArray->toRelaxedExtendedJSON(), "\n"; ?> ===DONE=== --EXPECT-- { "foo" : "bar" } { "0" : 1, "1" : 2, "2" : 3 } ===DONE===