Timestamp and UTCDateTime constructors should accept integers in strict types mode

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 1.2.0
    • Affects Version/s: 1.2.0-alpha2
    • Component/s: None
    • None
    • Environment:
      PHP 7
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The final zend_parse_parameters() calls in these functions (respecting the DateTimeInterface allowance for UTCDateTime) uses the "s" type. This causes PHP 7 to throw a TypeError if a string is not passed.

      Since union types are not available, we cannot hint for int|string and need some other way to relax the error and allow integers to be converted to strings.

      For context, the constructor argument parsing was last changed in d25e565 for PHPC-726.

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

                Created:
                Updated:
                Resolved: