Category
bug · php-src-strict · named arguments / Reflection
Problem
get_browser Reflection exposes browser_name instead of stub user_agent, so Zend named calls are rejected. Probed 2026-07-26 vs host Zend 8.2.32 (browscap may be unset — return value is not the defect).
| Repro |
Zend 8.2 |
VM (2026-07-26) |
| Reflection params |
user_agent,return_array |
browser_name,return_array |
get_browser(user_agent: null, return_array: true) |
binds (false / warning if no browscap) |
Unknown named parameter $user_agent |
php-src reference
PHP implementation target
lib/BuiltinParamNames.php — get_browser → ['user_agent','return_array'] (today browser_name)
- Reflection + named-arg dispatch; PHP-in-PHP only; no new C
Repro
./script/docker-exec.sh -- bash -lc 'php bin/vm.php -r '\''$r=new ReflectionFunction("get_browser"); echo implode(",", array_map(fn($p)=>$p->getName(), $r->getParameters())), "\n"; try { var_export(get_browser(user_agent: null, return_array: true)); echo "\n"; } catch (Throwable $e) { echo $e->getMessage(), "\n"; }'\'''
Done when
Category
bug· php-src-strict · named arguments / ReflectionProblem
get_browserReflection exposesbrowser_nameinstead of stubuser_agent, so Zend named calls are rejected. Probed 2026-07-26 vs host Zend 8.2.32 (browscap may be unset — return value is not the defect).user_agent,return_arraybrowser_name,return_arrayget_browser(user_agent: null, return_array: true)Unknown named parameter $user_agentphp-src reference
ext/standard/basic_functions.stub.php—get_browser(?string $user_agent = null, bool $return_array = false): object|array|falseext/standard/browscap.c—PHP_FUNCTION(get_browser)PHP implementation target
lib/BuiltinParamNames.php—get_browser→['user_agent','return_array'](todaybrowser_name)Repro
Done when
user_agent,return_arrayuser_agent:call binds withoutUnknown named parameteron VM (and JIT when in scope).phpt+test/repro/issue_NNNN_*.php