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

Always include __pclass property when decoding BSON to PHP

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.0.0-alpha1
    • Affects Version/s: 0.6.3
    • Component/s: None
    • Labels:
      None

      The serialization spec originally talked about excluding the __pclass property when decoding BSON to PHP. We previously spoke about including it to data passed to bsonUnserialize() but not array/stdClass values; however, I think we should simply always include it when decoding to PHP.

      This is easier to document for users and also guarantees that we the driver doesn't lose any fields when converting between BSON and PHP (similarly, __pclass would always be included for JSON conversions). This supports the idea of always being able to round-trip data without any loss.

            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: