Category
Stdlib · php-src-strict · Reflection functions
Problem
ReflectionFunction::isVariadic() is undefined on the VM for a user function with ...$c, while ReflectionMethod::isVariadic() and ReflectionParameter::isVariadic() already match Zend. Sibling #18228 closed the method path; the free-function path was left behind (2026-07-22).
| Repro |
Zend 8.2+ |
VM (2026-07-22) |
function f($a, $b=1, ...$c){} → ReflectionFunction::isVariadic() |
true |
method missing |
ReflectionMethod on m($a, ...$b) → isVariadic() |
true |
true (OK) |
getNumberOfRequiredParameters() / getNumberOfParameters() |
1 / 3 |
1 / 3 (OK) |
php-src reference
PHP implementation target
ext/standard/VmReflection.php — implement isVariadic() on the ReflectionFunction / shared abstract path from function flag / last-param variadic bit
- PHP-in-PHP only; no new C
Repro
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_reflection_function_is_variadic.php'
# compare: php test/repro/maintainer_gap_reflection_function_is_variadic.php
Done when
Category
Stdlib· php-src-strict · Reflection functionsProblem
ReflectionFunction::isVariadic()is undefined on the VM for a user function with...$c, whileReflectionMethod::isVariadic()andReflectionParameter::isVariadic()already match Zend. Sibling #18228 closed the method path; the free-function path was left behind (2026-07-22).function f($a, $b=1, ...$c){}→ReflectionFunction::isVariadic()trueReflectionMethodonm($a, ...$b)→isVariadic()truetrue(OK)getNumberOfRequiredParameters()/getNumberOfParameters()1/31/3(OK)php-src reference
ext/reflection/php_reflection.c—zim_reflection_function_abstract_isVariadic(shared by Function/Method)ReflectionMethod::isVariadic)PHP implementation target
ext/standard/VmReflection.php— implementisVariadic()on theReflectionFunction/ shared abstract path from function flag / last-param variadic bitRepro
Done when
ReflectionFunction::isVariadic()matches Zend for variadic and non-variadic free functions (incl. closures if applicable).phptunder reflection/