-
Type: New Feature
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
(copied to CRM)
Opening this to track the idea of allowing Int64 objects to be constructed explicitly. This would allow users to guarantee that a 64-bit integer BSON type is passed to MongoDB in an outgoing command.
That said, it's quite possible that the field type might later change when round-tripping the document, since a 64-bit integer type whose value is within the 32-bit range of signed integers would be narrowed back to a 32-bit integer type (unless the user again explicitly wrapped it with an Int64 object). I suppose an ODM would be able to work around that by enforcing specific typing for fields, and at the very least we'd still be removing one limitation from the driver (that being no direct construction of Int64 types).
This ticket was prompted by the following recent comments on older GitHub issues:
- is depended on by
-
PHPLIB-1147 Utilize Int64 constructor and integer casts in test suite
- Closed
- is related to
-
PHPC-1211 Create Int64 class to wrap 64-bit integers on 32-bit platforms
- Closed
- related to
-
PHPC-2212 Support overloaded operators for Int64 objects
- Closed