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

Ensure that null is still accepted for optional parameters

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.15.0
    • Affects Version/s: None
    • Component/s: 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@mongodb.com Andreas Braun
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: