Enforce zero arity in apache_get_version() and apache_get_modules() - #23102
Merged
Conversation
Both functions are declared with no parameters in the stub, but neither implementation called ZEND_PARSE_PARAMETERS_NONE(), so extra positional arguments were silently accepted instead of raising ArgumentCountError. Every other zero-arity function of the same SAPI (apache_request_headers(), apache_response_headers(), getallheaders()) already enforces its arity, and so does the litespeed implementation of apache_get_modules(). No stub or arginfo change is needed.
Girgias
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Both functions are declared with no parameters in
sapi/apache2handler/php_functions.stub.php, and the generated arginfo agrees, but neither implementation callsZEND_PARSE_PARAMETERS_NONE(), so extra positional arguments are silently accepted.Served by
php:8.4-apacheandphp:8.5-apache(PHP 8.4.24 and 8.5.9, Apache 2.4.68), identical on both:The first call should throw like the second one. Every other zero-arity function of this SAPI does enforce its arity, and so does
PHP_FUNCTION(apache_get_modules)insapi/litespeed/lsapi_main.c:1710, so the two SAPIs currently disagree on whetherapache_get_modules(1)is an error.No stub or arginfo change is needed. Targeting master rather than a stable branch, since the change turns a silently accepted call into an
ArgumentCountError.Sources: