Skip to content

Clarify forward_static_call() documentation - #5681

Closed
zonuexe wants to merge 1 commit into
php:masterfrom
zonuexe:clarify-forward-static-call-docs
Closed

Clarify forward_static_call() documentation#5681
zonuexe wants to merge 1 commit into
php:masterfrom
zonuexe:clarify-forward-static-call-docs

Conversation

@zonuexe

Copy link
Copy Markdown
Contributor

The forward_static_call() and forward_static_call_array() descriptions implied that these functions simply call static methods.

This clarifies that they call a callback while preserving the current called class for method callbacks, making them useful for static method callbacks that should behave like forwarding calls such as parent:: or self::.

The forward_static_call_array() parameter note is also updated to match call_user_func_array(): parameters can be passed by reference when the corresponding element in the args array is a reference.

I am not a native English speaker, so I do not have strong preferences about the exact wording or nuance.

@lacatoire

Copy link
Copy Markdown
Member

Thanks for the PR @zonuexe ! A commit landed on master (846dfb8) shortly after opening that covered the same ground. I'm closing to avoid conflict with it.

@zonuexe

Copy link
Copy Markdown
ContributorAuthor

Rebased on latest master and resolved the conflict with 846dfb8. I kept that commit's correction that forward_static_call_array() does not require an active class scope, and adjusted this PR to focus on clarifying late static binding/current called class behavior and the args-by-reference note consistent with call_user_func_array().

Sign up for freeto 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.

2 participants

@zonuexe@lacatoire