MongoDB\BSON\toPHPReturns the PHP representation of a BSON value 警告
This function has been DEPRECATED as of extension version 1.20.0 and will be removed in 2.0. Applications should use MongoDB\BSON\Document::toPHP instead. 説明
arrayobject MongoDB\BSON\toPHP(string
$bson , array $typeMap = array())
Unserializes a BSON document (i.e. binary string) to its PHP representation.
The 警告
BSON documents can technically contain duplicate keys because documents are stored as a list of key-value pairs; however, applications should refrain from generating documents with duplicate keys as server and driver behavior may be undefined. Since PHP objects and arrays cannot have duplicate keys, data could also be lost when decoding a BSON document with duplicate keys. パラメータ
戻り値The unserialized PHP value. エラー / 例外
変更履歴
例例1 MongoDB\BSON\toPHP example
上の例の出力は以下となります。 object(stdClass)#1 (1) { ["foo"]=> int(1) } 参考
|