Ensure that null is still accepted for optional parameters

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • 1.15.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In mongodb/mongo-php-driver#1338 for PHPC-2111, handling of optional parameters with zend_parse_parameters (e.g. parse string of "|a!") was replaced with newer macros such as Z_PARAM_ARRAY_OR_NULL; however, many of the corresponding stubs for these methods do not use a nullable type hint and thus PHP prohibits passing a null value at runtime. Attempting to do so results in an fatal error like "Arginfo / zpp mismatch during call of $method".

      I believe the relevant fix is to add nullable type hints to those parameters and regenerate the arginfo, but we should also add tests for these methods to ensure that null can be explicitly passed without error.

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

              Created:
              Updated:
              Resolved: