Document and PackedArray debug output does not preserve Int64 objects

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: 1.16.0
    • Component/s: BSON
    • None
    • PHP Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      The toPHP() methods in MongoDB\BSON\Document and MongoDB\BSON\PackedArray both enable int64_as_object: true in the type map; however, the option is not enabled for debug output. This results in Int64 values being presented as basic integer types when dumping the object with var_dump(), which might mislead users.

      I'm not sure if this was an oversight (and thus a possible bug), or intentional. If intentional, there may not be a good place to document this subtle behavioral difference since we don't maintain API docs for debug handlers (there technically isn't a __debugInfo() method).

      I encountered this while writing documentation examples for the BulkWriteCommandResult methods that return verbose results as Document instances (the server reports counts as Int64 types).

            Assignee:
            Unassigned
            Reporter:
            Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: