-
Type: Bug
-
Resolution: Fixed
-
Priority: Minor - P4
-
Affects Version/s: None
-
Component/s: None
-
None
This came up in the code review for PHPLIB-1001.
Both DocumentMatchConstraint (legacy test runner) and IsBsonType (unified test runner) only allow Int64 objects for "long" on a 32-bit platform (i.e. PHP_INT_SIZE is 4). There is no need to be this strict, and it could actually lead to an assertion failure since PHPC only instantiates Int64 when necessary. A 64-bit BSON integer with a value in the range of a signed 32-bit integer would decode as an integer primitive.
We can easily change this to just allow "long" to match both Int64 or an integer on any platform.
- is related to
-
PHPLIB-1001 Support "number" alias for $$type spec test operators
- Closed
- related to
-
PHPLIB-1011 DocumentsMatchConstraint $$type operator does not support arrays of multiple types
- Closed