Skip to content

Stdlib: get_browser Reflection/named params user_agent (#23382) - #31580

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-23382-get-browser-reflection
Aug 16, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/issue-23382-get-browser-reflection

Conversation

@PurHur

@PurHur PurHur commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Align get_browser Reflection/named-arg param names with php-src basic_functions.stub.php (user_agent, return_array).
  • Cite $user_agent in VM/JIT string-coercion TypeErrors; add focused PHPT + repro.

Closes #23382

php-src reference

  • ext/standard/basic_functions.stub.php — get_browser(?string $user_agent = null, bool $return_array = false)
  • PHP implementation: lib/BuiltinParamNames.php, ext/standard/get_browser.php

Test plan

  • ./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/issue_23382_get_browser_reflection.php'
  • ./script/docker-exec.sh -- bash -lc 'php bin/jit.php test/repro/issue_23382_get_browser_reflection.php'
  • ./script/phpunit.sh --filter GetBrowserReflectionNamed23382

Verification output

$ ./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/issue_23382_get_browser_reflection.php'
user_agent,return_array
false
Error

$ ./script/phpunit.sh --filter GetBrowserReflectionNamed23382
OK (2 tests, 2 assertions)

Made with Cursor

Match php-src basic_functions.stub.php so Reflection and named calls use
$user_agent instead of the legacy $browser_name label.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit f583ab1 into master Aug 16, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-23382-get-browser-reflection branch August 16, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant