Skip to content

Clarify forward_static_call docs - #5784

Merged
lacatoire merged 5 commits into
php:masterfrom
zonuexe:clarify-forward-static-call-docs-v2
Aug 21, 2026
Merged

Clarify forward_static_call docs#5784
lacatoire merged 5 commits 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

Comment thread reference/funchand/functions/forward-static-call-array.xml Outdated
Comment thread reference/funchand/functions/forward-static-call-array.xml Outdated
Comment thread reference/funchand/functions/forward-static-call.xml Outdated
zonuexe and others added 3 commits August 22, 2026 00:19
Co-authored-by: Louis-Arnaud <la.catoire@gmail.com>
Co-authored-by: Louis-Arnaud <la.catoire@gmail.com>
Co-authored-by: Louis-Arnaud <la.catoire@gmail.com>
Comment thread reference/funchand/functions/forward-static-call-array.xml Outdated
@lacatoire
lacatoire merged commit 17ddeef into php:master Aug 21, 2026
2 checks passed
@zonuexe
zonuexe deleted the clarify-forward-static-call-docs-v2 branch August 21, 2026 18:10
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.

2 participants