Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-410

BSON\fromPHP() handling of non-stdClass objects and unsupported BSON\Type instances

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.0.0-beta2
    • 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.

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: