Uploaded image for project: 'PHP Driver: Library'
  1. PHP Driver: Library
  2. PHPLIB-1010

Relax acceptance of Int64 for "long" in $$type spec test operators

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.15.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      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.

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

              Created:
              Updated:
              Resolved: