Commit b2cf4608e7b for php.net
commit b2cf4608e7bd99b044d98eebbc6467049391a23a
Author: Louis-Arnaud <la.catoire@gmail.com>
Date: Fri Aug 7 19:05:37 2026 +0200
Enforce zero arity in apache_get_version() and apache_get_modules() (#23102)
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.
Co-authored-by: lacatoire <ext-lacatoire@cenef.fr>
diff --git a/sapi/apache2handler/php_functions.c b/sapi/apache2handler/php_functions.c
index 1baa1f5225e..db2dcca72bd 100644
--- a/sapi/apache2handler/php_functions.c
+++ b/sapi/apache2handler/php_functions.c
@@ -308,6 +308,8 @@ static const char *php_apache_get_version(void)
/* {{{ Fetch Apache version */
PHP_FUNCTION(apache_get_version)
{
+ ZEND_PARSE_PARAMETERS_NONE();
+
const char *apv = php_apache_get_version();
if (apv && *apv) {
@@ -324,6 +326,8 @@ PHP_FUNCTION(apache_get_modules)
int n;
char *p;
+ ZEND_PARSE_PARAMETERS_NONE();
+
array_init(return_value);
for (n = 0; ap_loaded_modules[n]; ++n) {