Skip to content

[Sync-EN] Document named arguments support in the Reflection ...Args methods - #1798

Open
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:sync-en/1721
Open

[Sync-EN] Document named arguments support in the Reflection ...Args methods#1798
lacatoire wants to merge 1 commit into
php:masterfrom
lacatoire:sync-en/1721

Conversation

@lacatoire

Copy link
Copy Markdown
Member

Syncs the three reference/reflection/ pages with php/doc-en#5225.

ReflectionClass::newInstanceArgs(), ReflectionFunction::invokeArgs() and ReflectionMethod::invokeArgs() described args as a plain array of arguments. All three now state how the keys are interpreted:

  • all-numeric keys are ignored and the elements are passed positionally, in order;
  • string keys pass their element as a named argument under that name;
  • an Error is thrown when a numeric key follows a string key, or when a string key matches no parameter name.

ReflectionClass::newInstanceArgs() also gains the 8.0.0 changelog row: the keys are now interpreted as parameter names instead of being silently ignored.

EN-Revision bumped to 0f4bc7cf417d6c23a30f1b6e949c272651cf4ab4 on the three files.

Fixes: #1721

@lacatoire
lacatoire requested a review from a team as a code owner August 31, 2026 11:44
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.

[Sync EN] Document named arguments support in Reflection ...Args methods

1 participant