-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.0.0-alpha2
-
Component/s: None
-
None
derick' BSON serialization document says protected/private properties should be discarded
If an object is of any other class, without implementing any special interface, serialize as a BSON document. Keep only public properties, and ignore protected and private properties.
Currently that is not the case:
<?php class special { public $public = "public"; protected $protected = "protected"; private $private = "private"; } $special = new Special; $ret = MongoDB\BSON\toPHP(MongoDB\BSON\fromPHP($special)) var_dump($ret); ?>
object(stdClass)#2 (3) { ["public"]=> string(6) "public" ["protected"]=> string(9) "protected" ["private"]=> string(7) "private" }