Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-731

Parse Timestamp argument as strings to accept large integers

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.1.8
    • Fix Version/s: 1.2.0, 1.2.0-alpha2
    • Labels:
      None

      Description

      Timestamp's increment and timestamp components are unsigned 32-bit integers (max: 4294967295). On a 32-bit platform, 2147483647 will be the largest value accepted by the constructor since PHP's integers are signed.

      It's possible for such values to exist on a 32-bit platform after unserializing a Timestamp from raw BSON, in which case it would be printed as a negative value (via ZVAL_LONG).

      On a 32-bit platform, we should accept strings for these values, as we already do for UTCDateTime's milliseconds (a signed 64-bit integer). There are no Timestamp getter methods, so we need not worry about their return values. Strings can also be returned on 32-bit for var_dump(), serialization, and var_export() purposes (PHPC-460).

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: