Skip to content

Regression: get_browser Reflection names browser_name — Zend user_agent; named args rejected (ext/standard/basic_functions.stub.php) #23382

Description

@PurHur

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

  • Reflection names are user_agent,return_array
  • Zend-style named user_agent: call binds without Unknown named parameter on VM (and JIT when in scope)
  • Compliance .phpt + test/repro/issue_NNNN_*.php
  • php-src-strict; no php-compiler-strict shortcut

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:vmVirtual machinebugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions