-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 1.0.0-alpha2
-
Component/s: None
-
None
Currently, object_to_bson() does:
- Encodes non-object zvals (i.e. arrays) and stdClass instances as a stdClass
- Encodes supported BSON\Type instances accordingly
Objects that are not stdClass or a supported BSON\Type instance are completely ignored, which explains PHPC-408.
I propose that we throw an exception for unsupported BSON\Type instances (e.g. user attempts to create their own) and encode all other classes as if they were stdClass.