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

XMLWordPrintableJSON

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

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

                Created:
                Updated:
                Resolved: