Skip to content

Clarify forward_static_call docs - #5784

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

Clarify forward_static_call docs#5784
zonuexe wants to merge 1 commit into
php:masterfrom
zonuexe:clarify-forward-static-call-docs-v2

Conversation

@zonuexe

@zonuexe zonuexe commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

This PR replaces #5681 and has been rebased on the latest master after 846dfb8.

Commit 846dfb8 clarified that forward_static_call_array() does not require an active class scope and behaves like call_user_func_array() when called outside a class context.

This PR keeps that correction and focuses on the remaining parts not covered by that commit:

  • clarifying that forward_static_call() is not limited to calling static methods, but preserves the current called class for method callbacks
  • explaining how this relates to late static binding, where static:: resolves to the current called class
  • clarifying that this is useful for static method callbacks that should behave like forwarding calls such as parent:: or self::
  • updating the forward_static_call_array() parameter note to match call_user_func_array(): parameters can be passed by reference when the corresponding element in the args array is a reference

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.

1 participant