Skip to content

Stdlib: gettext family Zend stub names and named args (#24375) - #32137

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-24375-gettext-named-params
Aug 18, 2026
Merged

Stdlib: gettext family Zend stub names and named args (#24375)#32137
PurHur merged 1 commit into
masterfrom
agent/issue-24375-gettext-named-params

Conversation

@PurHur

@PurHur PurHur commented Aug 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Map gettext/_/ngettext/dgettext/dcgettext/dngettext/dcngettext/bindtextdomain through BuiltinParamNames to php-src ext/gettext/gettext.stub.php (message, singular/plural/count, domain/directory) so Reflection and named args match Zend.
  • InternalArgInfo still used catalog names (msgid, domain_name, dir); Zend named message: was Unknown named parameter, and VM also rejected its own msgid:.
  • PHP-in-PHP only (lib/BuiltinParamNames.php); no new runtime/ C.

Closes #24375

php-src: ext/gettext/gettext.stub.php

Test plan

  • VM repro
  • JIT repro
  • ./script/phpunit.sh --filter testGettextFamilyZendStubNamedParams
  • ./script/phpunit.sh --filter GettextNamedParams24375 (VM + JIT)
  • AOT of the same repro — compile-time named-arg check throws on the intentional gettext(msgid:) negative case (not in done-when)
  • Full ci-fast.sh / ci-local.sh not run (targeted gate only)

Verification

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/issue_24375_gettext_named_params.php'
gettext: message
ngettext: singular plural count
dgettext: domain message
dngettext: domain singular plural count
bindtextdomain: domain directory
x
items
World
a
bind-ok
Unknown named parameter $msgid

JIT (php bin/jit.php same repro): identical output.

./script/phpunit.sh --filter testGettextFamilyZendStubNamedParams
OK (1 test, 31 assertions)

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

Made with Cursor

InternalArgInfo still advertised msgid/domain_name/dir, so Reflection drifted
and Zend named message:/singular:/directory: were rejected. Map php-src
ext/gettext/gettext.stub.php names through BuiltinParamNames.

Co-authored-by: Cursor <cursoragent@cursor.com>
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: gettext/ngettext/dgettext/dngettext/bindtextdomain Reflection msgid* — Zend message/singular (ext/gettext/gettext.stub.php)

1 participant